I assume you registered as a developer and so get a developer account and the provisioning profile correctly set (should be in your keychain). If that's where your problem is, there are tons of tutorial to get that, on the Internet. For instance:
http://programming4.us/mobile/876.aspx
The thing is: you need to codesign anything that has to run on your real device (and for distribution), but no need for signing it when it only runs in the iOS Simulator. By default, the example projects are set as "don't codesign". It's fine for the iOS Simulator, but Xcode will complain if you try to make them run on your real device.
Fixing that is easy:
- go in the project navigator (by clicking the drawer-icon on the left of Xcode, just under the "run" button)
- click on the blue document icon, it will display the project's options in the right pannel
- click on "build settings"
- then scroll down until you reach the "code signing" section
- on the "code signing identity" line, click on the "don't code sign" default line and change it for your provisioning profile "iPhone Developer- blah blah"
- check that all the other lines of this section are set the same way, just to be sure
- compile, run and cry of joy
Why do those who are wrong always desagree with me?