views:

44

answers:

1

I looked around on Stack Overflow and I didn't find the solution of a strange problem.

I started developing a project on XCode 3.1 then I decided to upgrade on XCode 3.2.4 and targeting iOS3 iPhones. I then followed the topics dealing with that and I changed the Base SDK to iOS 4.1 and the target os to 3.0. Everything worked fine until I made changes to my project.

Indeed I added CoreMedia.framework to my project.

It worked well on simulator, but crashed at launch on the iPhone. Here is the log I can get:

<Notice>: dyld: Library not loaded: /System/Library/Frameworks/CoreMedia.framework/CoreMedia
Referenced from: /var/mobile/Applications/72F009B5-82A8-49DC-A5CD-708EE1A4553C/myapp.app/myapp
Reason: image not found

(I had the same problem with other frameworks like CoreVideo for example)

I tried on an iOS4 iPhone and it worked well, so I think XCode doesn't link/copy the right framework on the iPhone. When I get info on a framework under XCode, here is the path I get:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk/System/Library/Frameworks/MediaPlayer.framework

But I get the same path when I get info on a framework of the first version of the project (when I was using XCode 3.1). It sounds like the new frameworks added have a wrong reference.

Does anybody have an idea of how to solve this problem? Any help would be greatly appreciated. :)

+1  A: 

You have to weak link your libraries.

On xcode go to targets-> right click get info. on General tab on the lower section you will see your libs, change the CoreMedia type to be weak.

Ofcourse the lib won't be available on os3 so you'll need to add checks in your code so you wont call the lib on os3

Guy Ephraim
Thanks Guy for your answer. But the problem is that I need this framework on OS3. How can I do?
mat5454
this framework only exists on iOS4, there was a private API for iOS3 for doing these kind of stuff, however Apple stoped supporting it once iOS4 came out.
Guy Ephraim
You're right! I am stupid I didn't think to have a look at this. Thanks a lot for your help.
mat5454