dismissModalViewControllerAnimated crashes in ios 6.0 ipad simulator -
i using next code dismiss modal view controllers:
- (ibaction)done { #ifdef __iphone_5_0 if ([self respondstoselector:@selector(presentingviewcontroller)]) [self.presentingviewcontroller dismissmodalviewcontrolleranimated:yes]; else #endif [self.parentviewcontroller dismissmodalviewcontrolleranimated:yes]; }
if runt simulator using ios 4.3 ipad, uses self.parentviewcontroller
, works fine. however, when runt simulator using ios 6.0 ipad simulator crashes right after view dismissed using self.presentingviewcontroller
.
i not have actual ipad test on... ideas?
edit:
below code creates modal view controller.
nsarray* errors = [[nsarray alloc] initwithcontentsoffile:[[nsbundle mainbundle] pathforresource:@"errors" oftype:@"plist"]]; uiviewcontroller* vc; if (ui_user_interface_idiom() == uiuserinterfaceidiompad) { documentsviewcontroller_ipad* docsvc = [[documentsviewcontroller_ipad alloc] initwithnibname:@"documentsviewcontroller-ipad" bundle:nil]; docsvc.documents = errors; docsvc.errors = yes; docsvc.navtitle = @"troubleshooting"; vc = docsvc; } else { documentsviewcontroller* docsvc = [[documentsviewcontroller alloc] initwithnibname:nil bundle:nil]; docsvc.documents = errors; docsvc.errors = yes; docsvc.navtitle = @"troubleshooting"; vc = docsvc; } vc.modaltransitionstyle = uimodaltransitionstylecoververtical; [self presentmodalviewcontroller:vc animated:yes]; [vc release];
a few things:
yes, should utilizedismissviewcontrolleranimated:completion:
@rdelmar said you should phone call on presentingviewcontroller, not parent you can skip going presenting controller , dismiss self
, forwards message presenting controller if needed. ios
No comments:
Post a Comment