views:

1752

answers:

1

Hi,

I am having problems with my universal app. I have set the Base SDK to iPhone 3.2 and set the target to 3.1.

I have moved the files that are using the UIPopoverController to their own files and they shouldn't be loaded when loading the app on the iPhone. Still, when I build my app I get the following error when I build and debug to my device:

dyld: Symbol not found: _OBJC_CLASS_$_UIPopoverController Referenced from: /var/mobile/Applications/B3B90643-92DC-4E5C-8B2F-83A42D6D57E0/citybikes.app/citybikes Expected in: /System/Library/Frameworks/UIKit.framework/UIKit in /var/mobile/Applications/B3B90643-92DC-4E5C-8B2F-83A42D6D57E0/citybikes.app/citybikes

I really hope someone can help me.

Best regards, Paul Peelen

+7  A: 

Even if they're not loaded in runtime, those files are still processed in linking. The symbol _OBJC_CLASS_$_UIPopoverController is therefore added into your app as one of those requiring dynamic linking.

There are 2 workarounds,

  1. Replace all appearance of UIPopoverController in a message (e.g. [UIPopoverController alloc]) with NSClassFromString(@"UIPopoverController"), or
  2. Make UIKit weakly linked.
KennyTM
Thank you for your answer. What do you mean with "Make UIKit weakly linked"?The first one seems logic otherwise but best would be not to change my code at all, but I don't see that happening :( ./Paul
Paul Peelen
Also, how whould you first option work in the @interface section. I need to add the <UIPopoverControllerDelegate> and initiate a "UIPopoverController *popoverController;"
Paul Peelen
@Paul: That doesn't need to be changed. Only those inside `[...]` have to be changed.
KennyTM
@Paul: To make a library weakly linked, select your target, open "Info", then change the type from Required to Weak.
KennyTM
Great! I got it working now. Thank you for your help, your my hero! :)
Paul Peelen
are there any consequences for making uikit weakly linked?
Andy Jacobs
@Andy: Some link-time error may be hidden, and cause the app to crash at run-time.
KennyTM