Preparing a Universal App for iPhone SDK 3.2
I am working on a universal app, I used UISplitViewController in doing iPad application. I followed the Universal app guidelines i.e, i keep base SDK as 3.2, iPhone Target OS ad iPhone OS 3.1.3, Taget device as iPhone/iPad. And i used "Adding Runtime Checks for Newer Symbols" for UISplitViewController and UIPopOverController.
Class splitVCClass = NSClassFromString(@"UISplitViewController");
if (splitVC)
{
UISplitViewController* mySplitViewController = [[splitVCClass alloc] init];
// Configure the 开发者_运维百科split view controller.
}
I used this in .m files I declared UIPopOverController in .h files also
"dyld: Symbol not found: _OBJC_CLASS_$_UIPopoverController Referenced from: /var/mobile/Applications/9E0CE75F-D2A9-4132-AE56-1780928BCF21/UniversalTasks.app/UniversalTasks Expected in: /System/Library/Frameworks/UIKit.framework/UIKit in /var/mobile/Applications/9E0CE75F-D2A9-4132-AE56-1780928BCF21/UniversalTasks.app/UniversalTasks"
What i have to do can any one help me out
I am not entirely sure, but maybe this can help:
Class classPopoverController = NSClassFromString(@"UIPopoverController");
if (classPopoverController)
{
id popover = [[classPopoverController alloc] initWithContentViewController:imgPicker];
[popover presentPopoverFromRect:CGRectMake(0, 0, popoverParent.frame.size.width, 80)
inView:popoverParent permittedArrowDirections:(1UL << 0) animated:YES];
}
Basically you need to replace "UIPopoverController *" with "id", because this symbol is not defined in earlier SDK.
The correct answer is here: Symbol not found: _OBJC_CLASS_$_UIPopoverController
First you must take the original poster's implicit instructions: move all your iPad-only code (popovers etc) into iPad subclasses etc. Then follow the final answer.
精彩评论