Error when using downloaded example code: Failed to register bundle identifier

Thanks Mikaela and Chris,
your solution did not work for me, but I think I understood it now and it is not a problem any longer – please tell me, if the following is wrong.

First of all, the code builds and runs fine with the bundle identifier from apple as long as I am using the simulator. With my own code I directly used the app on my iPhone or iPad and that also works fine for my own bundle identifier. However, I have a developer account, but I am not part of Apple’s developer program (I understood this cost money and it is only needed, when I want to put an app on the App Store, right?). For this reason my provisioning profile is somehow restricted I guess.

Anyway, for some reason Apps that I write from scratch can be used on my devices, but the examples from Apple seem to run only in the simulator – which is fine by me. So I consider this solved.