Search code examples
iphonepicasa

How can I integrate the Picasa API into my iPhone application?


I have tried to integrate the Picasa API on iPhone, compiles fine, but I am seeing the following error on launch.

dyld: Library not loaded: @loader_path/../Frameworks/GData.framework/Versions/A/GData
  Referenced from: /Users/jacksu/Library/Application Support/iPhone Simulator/User/Applications/9A7E3F54-022F-4771-BD6A-E458F5545144/PicasaTest.app/PicasaTest
  Reason: image not found

I am not sure what could be the problem.

I imported the GDataFramework from Source/build/Debug/GData.framework. I have built the project under Source directory.


Solution

  • If you keep the GData.framework, then you need to make sure that it is not a required framework but rather a weak framework. A weak framework means, the app will not require it when first launched and only try to load it when a function call to the framework is referenced, but in your case since the library is statically compiled functions that are called will be resolved without a need to load the framework. (Note objective C messages are function calls in runtime...)

    To do that try the below:

    • Double click your application target (as before)

    • Look at the General tab this time

    • Find the GData.framework and change it from "Required" to "Weak"

    You are probably getting compile errors without adding the framework because the GDATA header files are not being resolved. You could have also put a link to the "header files" in "Header Search Path" Than you won't need to add the framework at all.

    Unrelated to the above, I forgot one more thing previously. Add -ObjC to your "Other Linker Flag".