IPhone crashes while animating navigation controller, what are my options?

I was looking for intermittent crash in my application. Finally, secrets are unlocked to signify my crash report, and here's what I found:

Incident Identifier: BFCE991E-5F9C-4F04-89AD-A0060EDE73D1
CrashReporter Key:   263d1a93e7ce2d75b397b6ef42b1bc4f29d22f9d
Hardware Model:      iPhone2,1
Process:         Wine Brain [2787]
Path:            /var/mobile/Applications/197DA851-3F8A-486E-8675-74B521A1FD72/Wine Brain.app/Wine Brain
Identifier:      Wine Brain
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2010-12-26 19:21:21.551 -0500
OS Version:      iPhone OS 4.2.1 (8C148a)
Report Version:  104

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000d
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                 0x3199f464 objc_msgSend + 16
1   Wine Brain                      0x0000a0b4 0x1000 + 37044
2   CoreFoundation                  0x31436f74 -[NSObject(NSObject) release] + 24
3   libobjc.A.dylib                 0x319a0812 objc_setProperty + 114
4   UIKit                           0x338f74a0 -[UINavigationController setDisappearingViewController:] + 24
5   UIKit                           0x338f7478 -[UINavigationController _clearLastOperation] + 40
6   UIKit                           0x338f7394 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 556
7   UIKit                           0x338f7128 -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 204
8   UIKit                           0x338f6dee -[UINavigationTransitionView _cleanupTransition] + 450
9   UIKit                           0x338f6c18 -[UINavigationTransitionView _navigationTransitionDidStop] + 36
10  UIKit                           0x338b4330 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184
11  UIKit                           0x338c0c0e -[UIViewAnimationState animationDidStop:finished:] + 34
12  QuartzCore                      0x30a89ea2 run_animation_callbacks(double, void*) + 286
13  QuartzCore                      0x30a89d44 CA::timer_callback(__CFRunLoopTimer*, void*) + 116
14  CoreFoundation                  0x3148709c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8
15  CoreFoundation                  0x31486b54 __CFRunLoopDoTimer + 844
16  CoreFoundation                  0x314581ae __CFRunLoopRun + 1082
17  CoreFoundation                  0x31457c80 CFRunLoopRunSpecific + 224
18  CoreFoundation                  0x31457b88 CFRunLoopRunInMode + 52
19  GraphicsServices                0x35d664a4 GSEventRunModal + 108
20  GraphicsServices                0x35d66550 GSEventRun + 56
21  UIKit                           0x338d5322 -[UIApplication _run] + 406
22  UIKit                           0x338d2e8c UIApplicationMain + 664
23  Wine Brain                      0x000021ba 0x1000 + 4538
24  Wine Brain                      0x00002184 0x1000 + 4484

As you can see, all this happens in the library code during the animation to navigate the navigation controller. This seems to happen when going back.

Any ideas on what might cause this, what I control and what to look for?

Update after some answers

I have this “template”, thanks to which I again use the view controller to display the results of different queries. My code has, say, 3 pointers to instances FetchedResultsController, and it has a property currentResultsthat points to the one used at that time.

.h file:

@interface MyViewController : UITableViewController <NSFetchedResultsControllerDelegate> {

  NSFetchedResultsController *controller1;
  NSFetchedResultsController *controller2;
  NSFetchedResultsController *controller3;

  // and other things unrelated
}

@property (nonatomic, retain) NSFetchedResultsController *currentController;

.m file:

-(void)clearAll {
  [controller1 release];
  controller1 = nil
  [controller2 release];
  controller2 = nil
  [controller3 release];
  controller3 = nil
}

, :

-(void)setupForSearch1 {
  self.currentController = [self controller1];
}
- (NSFetchedResultsController *)controller1 {

  NSFetchedResultsController *aController = [[[NSFetchedResultsController alloc] 
                                                 initWithFetchRequest:fetchRequest
                                                managedObjectContext:self.managedObjectContext 
                                                 sectionNameKeyPath:@"titleFirstLetter" 
                                                 cacheName:nil] autorelease];
  // error handling omitted for brevity
  controller1 = [aController retain];
  return controller1;
}    

, , ; setupForSearch1, currentController, , release . clearAll. , do , .

+3
4

, , .

+1

, , - , . , .

+1

.xib? didSelectRowAtIndexPath: , tableView.

0

, , .

, , , , UINavigationController, , .

 resultsVC = [[ResultsTableViewController alloc]initWithSearchResults:self.resultsArray];
 [self.view addSubview:resultsVC.view];

, , subView. , . , , , , .

    [resultsVC.view removeFromSuperview];
    resultsVC = nil;

, -, !

0

Source: https://habr.com/ru/post/1782288/


All Articles