iphone - Application crash due to UIAlertController in ios 8 -
iphone - Application crash due to UIAlertController in ios 8 -
i developing custom keyboard app , in app want show uialertcontroller crash next error.
terminating app due uncaught exception 'nsgenericexception', reason: 'your application has presented uialertcontroller () of style uialertcontrollerstyleactionsheet. modalpresentationstyle of uialertcontroller style uimodalpresentationpopover. must provide location info popover through alert controller's popoverpresentationcontroller. must provide either sourceview , sourcerect or barbuttonitem. if info not known when nowadays alert controller, may provide in uipopoverpresentationcontrollerdelegate method -prepareforpopoverpresentation.'
i used next code...
uialertcontroller * alert= [uialertcontroller alertcontrollerwithtitle:@"info" message:@"you using uialertcontroller" preferredstyle:uialertcontrollerstylealert]; uialertaction* ok = [uialertaction actionwithtitle:@"ok" style:uialertactionstyledefault handler:^(uialertaction * action) { [alert dismissviewcontrolleranimated:yes completion:nil]; }]; uialertaction* cancel = [uialertaction actionwithtitle:@"cancel" style:uialertactionstyledefault handler:^(uialertaction * action) { [alert dismissviewcontrolleranimated:yes completion:nil]; }]; [alert addaction:ok]; [alert addaction:cancel]; [self presentviewcontroller:alert animated:yes completion:nil];
so how can solve?
iphone ios8 uialertcontroller
Comments
Post a Comment