iPhone Programming
Posted: Mon 29 Jun, 2009 6:33 am
I'm going to put useful iPhone programming information into this thread as time progresses and we wrestle with the iPhone API. Anyone can contribute to the thread though so feel free to join in.
Retrieving debug output files from an iPhone
Data under your applications writable areas is accessible via. the 'Organiser' on Xcode (highlight the device and then open the application being debugged in the bottom panel - then hit the 'arrow' button to download the information onto your Mac). This is invaluable as it allows you get information off the device when running outside of the debugger (for instance outputting information to a debug text file).
Thumb executable builds
By default Xcode will build 'Thumb executables' for the iPhone. Be warned if programming applications requiring speed these can be much slower than a non-thumb build.
Organizer says "Could not support development.
This error appears very occasionally when you attempt to use your hardware for debugging (appears in the Xcode Organiser instead of the normal list of provisioning profiles and applications).
This most commonly occurs after updating a device with a new provisioning file and can be 'cleared' by rebooting the device in question.
Failure to run app outside of Xcode debug
You may find that your application runs fine through the debugger in Xcode but fails to launch when you attempt to run it natively on the hardware (ie. by clicking on the icon on the iPhone). This is normally attributable to the startup for the program taking longer than the OS allows; in which case the operating system helpfully kills the program without giving any visible notifacation of why this has happened.
You can confirm this by making the program spool debug to the output stream and following its output in the Xcode 'Organiser' Console window.
Retrieving debug output files from an iPhone
Data under your applications writable areas is accessible via. the 'Organiser' on Xcode (highlight the device and then open the application being debugged in the bottom panel - then hit the 'arrow' button to download the information onto your Mac). This is invaluable as it allows you get information off the device when running outside of the debugger (for instance outputting information to a debug text file).
Thumb executable builds
By default Xcode will build 'Thumb executables' for the iPhone. Be warned if programming applications requiring speed these can be much slower than a non-thumb build.
Organizer says "Could not support development.
This error appears very occasionally when you attempt to use your hardware for debugging (appears in the Xcode Organiser instead of the normal list of provisioning profiles and applications).
This most commonly occurs after updating a device with a new provisioning file and can be 'cleared' by rebooting the device in question.
Failure to run app outside of Xcode debug
You may find that your application runs fine through the debugger in Xcode but fails to launch when you attempt to run it natively on the hardware (ie. by clicking on the icon on the iPhone). This is normally attributable to the startup for the program taking longer than the OS allows; in which case the operating system helpfully kills the program without giving any visible notifacation of why this has happened.
You can confirm this by making the program spool debug to the output stream and following its output in the Xcode 'Organiser' Console window.