views:

642

answers:

3

Hi,

I'm writing an iPhone app that needs direct access to the camera. Since it is in-house, I have no qualms about using the full set of headers and private frameworks.
I included and the PhotoLibrary framework in the application. It compiles for the 2.0 firmware, and I can put it on the device and run it. As soon as it is started, however, it quits and returns to the home screen.

I think that the PhotoLibrary framework is somehow not being loaded or something similar.

I would post some debugging output, but I don't actually have the phone yet.

Thanks!

A: 

That might or might not be the problem. The iPhone simulator lets you get away with a lot of stuff that doesn't work on an actual device-- there's any number of classes that a simulator app can use that don't exist on the phone (e.g. NSXMLDocument, available on Mac OS X and iPhone simulator but not actual iPhones). Get the phone, run the app, and use Xcode to look at the phone's system console to see why it's crashing.

Tom Harrington
Thanks for the info. Unfortunatlely, I haven't gotten my own device yet - I've been sending my files to someone else. I will follow your advice as soon as my phone comes next week.
Be sure you are compiling with the "Device" SDK option rather than the "Simulator" option. The simulator option will compile an x86 binary rather than the ARM type the iPhone is expecting. Also, make sure the target device is either provisioned correctly, or jailbroken.
rpetrich
A: 

Thanks for all the help.

It turns out that I was trying to use classes from the iPhone 2.0 SDK with an iPhone that has 2.2.1. Thus, it would compile correctly when I set the device to 2.0 in Xcode, but would fail on the iPhone because the old classes were no longer there.

I fixed my problem by getting the classes from the 2.2.1 SDK. Now my program runs fine on the iPhone.

A: 

How can you import private framework? I did import but it said that the header file imported is no such a folder o file.

I already set search Header file path in project setting

Do i need to copy class-dumped header to any specific fold in xcode?

Anh