iPad: UIImagePickerController
How do you use the image picker controller on the iPad? My iphone version works fine but I get a UI Mess on the iPad. (Part of the nav bar loads and nothing else.) Anyway so I tried if ([[[UIDevice currentDevice]model]containsString:@iPad]){ if( [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary ] || [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum ]) { mainPicker = [[UIImagePickerController alloc] init]; NSLog(@Picker %@,mainPicker); mainPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary UIImagePickerControllerSourceTypeSavedPhotosAlbum; mainPicker.delegate = self; mainPicker.allowsImageEditing = YES; [[UIApplication sharedApplication]setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES]; [delegate slideSubview:pickerParent fromTop:YES]; [self presentModalViewController:mainPicker animated:YES]; } } And now it crashes telling me I have to use a popover: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'On iPad, UIImagePickerController must be presented via UIPopoverController' Are the any examples of how to present a UIImagePicker on the iPad?___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPad: UIImagePickerController
On Apr 7, 2010, at 3:37 PM, Development wrote: How do you use the image picker controller on the iPad? My iphone version works fine but I get a UI Mess on the iPad. And now it crashes telling me I have to use a popover: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'On iPad, UIImagePickerController must be presented via UIPopoverController' That's because on iPad, image pickers must be used within a popover (just what the exception instructs). I strongly suggest you read the iPad Human Interface Guidelines as well as the corresponding programming guide. Also, a potential better forum for UIKit questions is the dedicated iPhone OS forums at developer.apple.com ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPad: UIImagePickerController
On Apr 7, 2010, at 1:37 PM, Development wrote: How do you use the image picker controller on the iPad? My iphone version works fine but I get a UI Mess on the iPad. (Part of the nav bar loads and nothing else.) Anyway so I tried if ([[[UIDevice currentDevice]model]containsString:@iPad]){ No. Don't do this. If you want to check for iPad, use if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomiPad). There's also a convenience macro included in UIDevice.h intended for people deploying on pre-3.2 versions of the OS so you won't crash on unknown selector. And now it crashes telling me I have to use a popover: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'On iPad, UIImagePickerController must be presented via UIPopoverController' Are the any examples of how to present a UIImagePicker on the iPad?___ Create a popover, add the picker as the content view controllerviola. Luke___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iPad: UIImagePickerController
I had gotten lost because I forgot that I had the project's base SDK set to 3.0 so that the iPhone version would build and launch. I couldn't find the popover controller api and was very confused. Sorry. On Apr 7, 2010, at 1:43 PM, Ricky Sharp wrote: On Apr 7, 2010, at 3:37 PM, Development wrote: How do you use the image picker controller on the iPad? My iphone version works fine but I get a UI Mess on the iPad. And now it crashes telling me I have to use a popover: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'On iPad, UIImagePickerController must be presented via UIPopoverController' That's because on iPad, image pickers must be used within a popover (just what the exception instructs). I strongly suggest you read the iPad Human Interface Guidelines as well as the corresponding programming guide. Also, a potential better forum for UIKit questions is the dedicated iPhone OS forums at developer.apple.com ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com