Saturday, 15 January 2011

objective c - Trying to dismiss UIAlertController iOS 8 -



objective c - Trying to dismiss UIAlertController iOS 8 -

crashlytics send me error in app:

fatal exception: nsinternalinconsistencyexception trying dismiss uialertcontroller <uialertcontroller: 0x14de40020> unknown presenter. uikit -[uialertcontroller _dismissanimated:triggeringaction:triggeredbypopoverdimmingview:] + 584

this problem occurs in ios 8 when seek reproduce error, alertviews work correctly in ios 8 , nil bad happens. why problem happening?

i have read in ios 8 uialertview deprecated , now, have utilize uialertcontroller when seek utilize uialertcontroller can't dismiss alert , functionality not same.

please help me.

thank advance.

edit:

the code want alter this:

uialertview * alerta = [[uialertview alloc] initwithtitle: amlocalizedstring(@"alertupdate", @"") message:@"\n" delegate:self cancelbuttontitle:nil otherbuttontitles:nil]; uiactivityindicatorview *spinner = [[uiactivityindicatorview alloc] initwithactivityindicatorstyle:uiactivityindicatorviewstylegray]; spinner.center = cgpointmake(139.5, 75.5); // .5 doesn't blur [alerta addsubview:spinner]; [spinner startanimating]; [alerta show]; uistoryboard *storyboard = [uistoryboard storyboardwithname:dis bundle:nil]; mainvc *main = [storyboard instantiateviewcontrollerwithidentifier:@"mainvc"]; uinavigationcontroller *navcontrol = [[uinavigationcontroller alloc] initwithrootviewcontroller: main]; [self presentmodalviewcontroller: navcontrol animated: yes]; [alerta dismisswithclickedbuttonindex:0 animated:yes];

replace this

[self presentmodalviewcontroller: navcontrol animated: yes]; [alerta dismisswithclickedbuttonindex:0 animated:yes];

with this

[alerta dismisswithclickedbuttonindex:0 animated:yes]; [[nsoperationqueue mainqueue] addoperationwithblock:^{ [self presentmodalviewcontroller: navcontrol animated: yes]; }];

this presents new controller asynchronously create sure alert view dismissed

ios objective-c uialertview uialertcontroller

No comments:

Post a Comment