Hello,
I'm trying to make a conditional statement to remove a code if the device is not iPad, my app is a universal app.
here is the code:
that code isn't working and my app is crashing on any iPhone/iPod, I tried another code provided by apple team in their forum
but it doesn't work either.
i get this error:
any help please?
I'm trying to make a conditional statement to remove a code if the device is not iPad, my app is a universal app.
here is the code:
Code:
- (IBAction)presentMasterInPopoverFromBarButtonItem:(UIBarButtonItem *)barButtonItem {
if ([UIDevice instancesRespondToSelector:@selector(userInterfaceIdiom)]&&[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker];
self.popoverController = popover;
[popover release];
[popoverController presentPopoverFromBarButtonItem:barButtonItem permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
[picker release];
} else {
NSLog(@"iPhone Idiom");
}
}
that code isn't working and my app is crashing on any iPhone/iPod, I tried another code provided by apple team in their forum
Code:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
but it doesn't work either.
i get this error:
Code:
dyld: Symbol not found: _OBJC_CLASS_$_UIPopoverController
Referenced from: /var/mobile/Applications/F04EED5E-8150-4477-8E1C-855CD74D6198/Pixels.app/Pixels
Expected in: /System/Library/Frameworks/UIKit.framework/UIKit
any help please?