Odd errors when testing on iphone, after device is disconnected
I've noticed that when I upload my code to my test device, it works fine... right up to the point that I unplug it from the computer. I assume this is because it 开发者_StackOverflow中文版needs to connect to the debugger or something, but I'd very much like to ensure that the program will work once it's distributed. How should I go about setting up the program so I can test it without a direct computer connection?
-Ash
You app is probably launching in the debugger, and you are crashing that process.
First start your app (Build & Run), then quit the app on the device, and then quit the debugger (hit Stop in Xcode), before pulling the cable. They you can (re)start your app on the device with no debugger in the loop.
You don't need to have your device plugged in to test your app. Just tap its icon from Springboard to launch it. I test my iPhone and iPad apps "offline" in this manner all the time.
精彩评论