objective c - Strange dismissViewControllerAnimated Crash - iOS 8 -


my app crashing, in ios 8.4, when try dismissviewcontrolleranimated:no, after alert uitextfield.

changing animated yes it's working well, guess that's not fix.


code: (uimodalpresentationcurrentcontext modal)

- (ibaction)openalertwithtextfield:(id)sender {     uialertview * alert = [[uialertview alloc] initwithtitle:@"" message:@"type number:" delegate:self cancelbuttontitle:@"cancel" otherbuttontitles:@"confirm", nil];     [alert setalertviewstyle:uialertviewstyleplaintextinput];     uitextfield * alerttextfield = [alert textfieldatindex:0];     [alerttextfield setkeyboardtype:uikeyboardtypenumberpad];     [alerttextfield setdelegate:self];     [alert show]; }  #pragma mark - uialertviewdelegate - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex {     if (buttonindex == 1) {         // crash         [self dismissviewcontrolleranimated:no completion:nil];          // no crash         [self dismissviewcontrolleranimated:yes completion:nil];     } } 

crash log:

crashed: com.apple.main-thread exc_bad_access kern_invalid_address 0x0000000000000010  crashed: com.apple.main-thread 0  libobjc.a.dylib                0x1981c7bd0 objc_msgsend + 16 1  uikit                          0x18b29c9dc -[uitextfield _shouldendediting] + 84 2  uikit                          0x18b21ac70 -[uiresponder resignfirstresponder] + 84 3  uikit                          0x18b29c8bc -[uitextfield resignfirstresponder] + 124 4  uikit                          0x18b29395c -[uiview(hierarchy) _removefirstresponderfromsubtree] + 208 5  uikit                          0x18b43effc __uiviewwillberemovedfromsuperview + 96 6  uikit                          0x18b16ac48 -[uiview(hierarchy) removefromsuperview] + 108 7  uikit                          0x18b47a94c __71-[uipresentationcontroller _initviewhierarchyforpresentationsuperview:]_block_invoke504 + 364 8  uikit                          0x18b476784 -[uipresentationcontroller transitiondidfinish:] + 112 9  uikit                          0x18b4790c0 __56-[uipresentationcontroller runtransitionforcurrentstate]_block_invoke_2 + 168 10 uikit                          0x18b292f64 -[_uiviewcontrollertransitioncontext completetransition:] + 132 11 uikit                          0x18b1a8708 -[uiviewanimationblockdelegate _didendblockanimation:finished:context:] + 408 12 uikit                          0x18b1a8270 -[uiviewanimationstate senddelegateanimationdidstop:finished:] + 188 13 uikit                          0x18b1a8178 -[uiviewanimationstate animationdidstop:finished:] + 104 14 quartzcore                     0x18aab162c ca::layer::run_animation_callbacks(void*) + 296 15 libdispatch.dylib              0x198831954 _dispatch_client_callout + 16 16 libdispatch.dylib              0x19883620c _dispatch_main_queue_callback_4cf + 1608 17 corefoundation                 0x1866af7f8 __cfrunloop_is_servicing_the_main_dispatch_queue__ + 12 18 corefoundation                 0x1866ad8a0 __cfrunlooprun + 1492 19 corefoundation                 0x1865d92d4 cfrunlooprunspecific + 396 20 graphicsservices               0x18feef6fc gseventrunmodal + 168 21 uikit                          0x18b1d6f40 uiapplicationmain + 1488 22 in manager                 0x10006320c main (main.m:16) 23 libdyld.dylib                  0x19885ea08 start + 4 

zoombie:

2016-05-25 03:02:26.699 app[75590:5686413] *** -[myuiviewcontroller respondstoselector:]: message sent deallocated instance 0x7ff1a2f7a7f0 

you doing , should try doing in this:

- alertview:diddismisswithbuttonindex: 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -