3

내 ipad 응용 프로그램에 문제가 있습니다.[controllerWillChangeContent :] : 할당 취소 된 인스턴스로 전송 된 메시지

두 가지 방법으로 액세스 할 수있는보기가 있습니다. 한 방향으로 가면 완벽하게 작동합니다. 그래도 다른 것을 통해 들어가면 컨텍스트를 저장할 때 충돌이 발생합니다. 나는 그것을 의심

은 부모에 뭔가 (고객이 주문)입니다 - 나는 메시지와 함께 좀비를 얻을 : 0x10102020 내가 intstruments를 통해 실행할 때 메시지 할당이 해제 된 인스턴스로 전송 :

[OrdersByCustomer controllerWillChangeContent :] 좀비와 내가 얻을 : 나는 OrderDetailsViewController 호출 오전

# Category Event Type RefCt Timestamp Address Size Responsible  Library Responsible Caller 
0 OrdersByCustomer Malloc 1 00:35.545.273 0x89cafc0 272 Dentanet -[CustomersRootController tableView:didSelectRowAtIndexPath:] 
1 OrdersByCustomer Retain 2 00:35.545.357 0x89cafc0 0 Dentanet -[CustomersRootController tableView:didSelectRowAtIndexPath:] 
2 OrdersByCustomer Retain 3 00:35.545.414 0x89cafc0 0 UIKit -[UISplitViewController setViewControllers:] 
3 OrdersByCustomer Release 2 00:35.545.434 0x89cafc0 0 UIKit -[UISplitViewController setViewControllers:] 
4 OrdersByCustomer Retain 3 00:35.546.380 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
5 OrdersByCustomer Retain 4 00:35.546.406 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
6 OrdersByCustomer Retain 5 00:35.546.631 0x89cafc0 0 UIKit -[UIProxyObject initWithCoder:] 
7 OrdersByCustomer Retain 6 00:35.546.636 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
8 OrdersByCustomer Retain 7 00:35.546.665 0x89cafc0 0 Foundation -[NSKeyedUnarchiver _replaceObject:withObject:] 
9 OrdersByCustomer Release 6 00:35.546.669 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
10 OrdersByCustomer Retain 7 00:35.546.671 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
11 OrdersByCustomer Autorelease  00:35.546.682 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
12 OrdersByCustomer Retain 8 00:35.546.687 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
13 OrdersByCustomer Retain 9 00:35.548.308 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
14 OrdersByCustomer Autorelease  00:35.548.310 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
15 OrdersByCustomer Retain 10 00:35.548.313 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
16 OrdersByCustomer Retain 11 00:35.548.363 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
17 OrdersByCustomer Autorelease  00:35.548.365 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
18 OrdersByCustomer Retain 12 00:35.548.367 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
19 OrdersByCustomer Retain 13 00:35.552.662 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
20 OrdersByCustomer Autorelease  00:35.552.665 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
21 OrdersByCustomer Retain 14 00:35.552.667 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
22 OrdersByCustomer Retain 15 00:35.554.265 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
23 OrdersByCustomer Autorelease  00:35.554.267 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
24 OrdersByCustomer Retain 16 00:35.554.270 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
25 OrdersByCustomer Retain 17 00:35.555.888 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
26 OrdersByCustomer Autorelease  00:35.555.891 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
27 OrdersByCustomer Retain 18 00:35.555.893 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
28 OrdersByCustomer Retain 19 00:35.557.078 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
29 OrdersByCustomer Autorelease  00:35.557.081 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
30 OrdersByCustomer Retain 20 00:35.557.083 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
31 OrdersByCustomer Retain 21 00:35.558.379 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
32 OrdersByCustomer Autorelease  00:35.558.382 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
33 OrdersByCustomer Retain 22 00:35.558.384 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
34 OrdersByCustomer Retain 23 00:35.558.428 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
35 OrdersByCustomer Autorelease  00:35.558.430 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
36 OrdersByCustomer Retain 24 00:35.558.434 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
37 OrdersByCustomer Retain 25 00:35.559.611 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
38 OrdersByCustomer Autorelease  00:35.559.614 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
39 OrdersByCustomer Retain 26 00:35.559.617 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
40 OrdersByCustomer Retain 27 00:35.561.021 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
41 OrdersByCustomer Autorelease  00:35.561.024 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
42 OrdersByCustomer Retain 28 00:35.561.026 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
43 OrdersByCustomer Retain 29 00:35.574.693 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
44 OrdersByCustomer Autorelease  00:35.574.695 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
45 OrdersByCustomer Retain 30 00:35.574.699 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
46 OrdersByCustomer Retain 31 00:35.576.664 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
47 OrdersByCustomer Autorelease  00:35.576.665 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
48 OrdersByCustomer Retain 32 00:35.576.667 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
49 OrdersByCustomer Retain 33 00:35.578.215 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
50 OrdersByCustomer Autorelease  00:35.578.217 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
51 OrdersByCustomer Retain 34 00:35.578.220 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
52 OrdersByCustomer Retain 35 00:35.579.428 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
53 OrdersByCustomer Autorelease  00:35.579.430 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
54 OrdersByCustomer Retain 36 00:35.579.433 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
55 OrdersByCustomer Retain 37 00:35.580.833 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
56 OrdersByCustomer Autorelease  00:35.580.835 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
57 OrdersByCustomer Retain 38 00:35.580.837 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
58 OrdersByCustomer Retain 39 00:35.582.224 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
59 OrdersByCustomer Autorelease  00:35.582.226 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
60 OrdersByCustomer Retain 40 00:35.582.229 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
61 OrdersByCustomer Retain 41 00:35.583.419 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
62 OrdersByCustomer Autorelease  00:35.583.421 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
63 OrdersByCustomer Retain 42 00:35.583.424 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
64 OrdersByCustomer Retain 43 00:35.584.848 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
65 OrdersByCustomer Autorelease  00:35.584.850 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
66 OrdersByCustomer Retain 44 00:35.584.853 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
67 OrdersByCustomer Retain 45 00:35.584.895 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
68 OrdersByCustomer Autorelease  00:35.584.898 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
69 OrdersByCustomer Retain 46 00:35.584.900 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
70 OrdersByCustomer Retain 47 00:35.584.952 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
71 OrdersByCustomer Autorelease  00:35.584.954 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
72 OrdersByCustomer Retain 48 00:35.584.957 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
73 OrdersByCustomer Retain 49 00:35.587.241 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
74 OrdersByCustomer Autorelease  00:35.587.244 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
75 OrdersByCustomer Retain 50 00:35.587.246 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
76 OrdersByCustomer Retain 51 00:35.587.288 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
77 OrdersByCustomer Autorelease  00:35.587.291 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
78 OrdersByCustomer Retain 52 00:35.587.293 0x89cafc0 0 UIKit -[UIRuntimeConnection initWithCoder:] 
79 OrdersByCustomer Release 51 00:35.598.083 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
80 OrdersByCustomer Release 50 00:35.598.087 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
81 OrdersByCustomer Release 49 00:35.598.098 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
82 OrdersByCustomer Release 48 00:35.598.105 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
83 OrdersByCustomer Release 47 00:35.598.110 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
84 OrdersByCustomer Release 46 00:35.598.120 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
85 OrdersByCustomer Release 45 00:35.598.128 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
86 OrdersByCustomer Release 44 00:35.598.135 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
87 OrdersByCustomer Release 43 00:35.598.142 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
88 OrdersByCustomer Release 42 00:35.598.149 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
89 OrdersByCustomer Release 41 00:35.598.157 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
90 OrdersByCustomer Release 40 00:35.598.164 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
91 OrdersByCustomer Release 39 00:35.598.171 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
92 OrdersByCustomer Release 38 00:35.598.178 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
93 OrdersByCustomer Release 37 00:35.598.185 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
94 OrdersByCustomer Release 36 00:35.598.190 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
95 OrdersByCustomer Release 35 00:35.598.200 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
96 OrdersByCustomer Release 34 00:35.598.208 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
97 OrdersByCustomer Release 33 00:35.598.214 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
98 OrdersByCustomer Release 32 00:35.598.221 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
99 OrdersByCustomer Release 31 00:35.598.228 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
100 OrdersByCustomer Release 30 00:35.598.233 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
101 OrdersByCustomer Release 29 00:35.598.242 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
102 OrdersByCustomer Retain 30 00:35.598.276 0x89cafc0 0 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] 
103 OrdersByCustomer Retain 31 00:35.598.358 0x89cafc0 0 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] 
104 OrdersByCustomer Release 30 00:35.598.369 0x89cafc0 0 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] 
105 OrdersByCustomer Retain 31 00:35.598.379 0x89cafc0 0 Foundation -[NSArray(NSArray) initWithCoder:] 
106 OrdersByCustomer Release 30 00:35.598.403 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
107 OrdersByCustomer Retain 31 00:35.598.507 0x89cafc0 0 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] 
108 OrdersByCustomer Retain 32 00:35.598.594 0x89cafc0 0 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] 
109 OrdersByCustomer Release 31 00:35.598.732 0x89cafc0 0 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] 
110 OrdersByCustomer Retain 32 00:35.598.742 0x89cafc0 0 Foundation -[NSArray(NSArray) initWithCoder:] 
111 OrdersByCustomer Release 31 00:35.598.832 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
112 OrdersByCustomer Release 30 00:35.600.007 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
113 OrdersByCustomer Release 29 00:35.600.036 0x89cafc0 0 UIKit -[UINib instantiateWithOwner:options:] 
114 OrdersByCustomer Release 28 00:35.600.249 0x89cafc0 0 Foundation -[NSKeyedUnarchiver dealloc] 
115 OrdersByCustomer Release 27 00:35.600.300 0x89cafc0 0 Foundation -[NSKeyedUnarchiver dealloc] 
116 OrdersByCustomer Release 26 00:35.600.314 0x89cafc0 0 Foundation -[NSKeyedUnarchiver dealloc] 
117 OrdersByCustomer Release 25 00:35.600.535 0x89cafc0 0 Foundation -[NSKeyedUnarchiver dealloc] 
118 OrdersByCustomer Release 24 00:35.600.684 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
119 OrdersByCustomer Release 23 00:35.600.698 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
120 OrdersByCustomer Release 22 00:35.600.716 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
121 OrdersByCustomer Release 21 00:35.600.732 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
122 OrdersByCustomer Release 20 00:35.600.747 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
123 OrdersByCustomer Release 19 00:35.600.763 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
124 OrdersByCustomer Release 18 00:35.600.778 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
125 OrdersByCustomer Release 17 00:35.600.791 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
126 OrdersByCustomer Release 16 00:35.600.809 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
127 OrdersByCustomer Release 15 00:35.600.825 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
128 OrdersByCustomer Release 14 00:35.600.840 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
129 OrdersByCustomer Release 13 00:35.600.856 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
130 OrdersByCustomer Release 12 00:35.600.871 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
131 OrdersByCustomer Release 11 00:35.600.887 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
132 OrdersByCustomer Release 10 00:35.600.902 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
133 OrdersByCustomer Release 9 00:35.600.918 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
134 OrdersByCustomer Release 8 00:35.600.934 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
135 OrdersByCustomer Release 7 00:35.600.949 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
136 OrdersByCustomer Release 6 00:35.600.962 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
137 OrdersByCustomer Release 5 00:35.600.980 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
138 OrdersByCustomer Release 4 00:35.600.996 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
139 OrdersByCustomer Release 3 00:35.601.008 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
140 OrdersByCustomer Release 2 00:35.601.027 0x89cafc0 0 UIKit -[UIRuntimeConnection dealloc] 
141 OrdersByCustomer Release 1 00:35.860.285 0x89cafc0 0 Dentanet -[CustomersRootController tableView:didSelectRowAtIndexPath:] 
142 OrdersByCustomer Retain 2 00:40.062.038 0x89cafc0 0 UIKit -[UISplitViewController setViewControllers:] 
143 OrdersByCustomer Release 1 00:40.140.010 0x89cafc0 0 UIKit -[UISplitViewController setViewControllers:] 
144 OrdersByCustomer Release 0 00:40.140.893 0x89cafc0 0 GraphicsServices GSEventRunModal 
145 OrdersByCustomer Zombie -1 00:42.129.646 0x89cafc0 0 CoreData -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] 

- 내가 여기 컨텍스트 저장하려고하면 오류가 발생합니다

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 

NSArray *viewControllers; 

if (scOrdersInvoices.selectedSegmentIndex == INVOICES){ 

    InvoiceDetailsViewController <SubstitutableDetailViewController> *invoiceDetailsViewController = 
    [[InvoiceDetailsViewController alloc] initWithNibName:@"InvoiceDetailsView" bundle:nil]; 

    invoiceDetailsViewController.invoice = [_fetchedInvoicesResultsController objectAtIndexPath:indexPath]; 
    invoiceDetailsViewController.tempPopoverButtonItem = self.rootPopoverButtonItem; 

    viewControllers = [[NSArray alloc] initWithObjects: 
         [appDelegate.splitViewController.viewControllers objectAtIndex:0], 
         invoiceDetailsViewController, 
         nil]; 
    appDelegate.splitViewController.viewControllers = viewControllers; 

    [invoiceDetailsViewController release]; 
    [viewControllers release]; 
    return; 
} 

Orders *newOrder = [[_fetchedOrdersResultsController fetchedObjects] objectAtIndex:indexPath.row]; 
if (newOrder) 
{ 

    OrderDetailsViewController <SubstitutableDetailViewController> *orderDetailsViewController = [[OrderDetailsViewController alloc] initWithNibName:@"OrderDetailsView" bundle:nil]; 
    orderDetailsViewController.tempPopoverButtonItem = self.rootPopoverButtonItem; 
    orderDetailsViewController.orders = newOrder; 
    orderDetailsViewController.iCalledFrom = 1; 
    NSArray *viewControllers = [[NSArray alloc]initWithObjects: 
           [appDelegate.splitViewController.viewControllers objectAtIndex:0], 
           orderDetailsViewController, 
           nil]; 
    appDelegate.splitViewController.viewControllers = viewControllers;   
    [orderDetailsViewController release]; 
    [viewControllers release]; 

}  

} `

다음 OrdersDetailViewController 내있는 viewDidLoad는 :

- (void)viewDidLoad 
{ 
appDelegate = (D4AppDelegate *)[[UIApplication sharedApplication]delegate]; 
self.managedObjectContext = appDelegate.managedObjectContext; 
HistoryOrCatalogController *hoc = [[HistoryOrCatalogController alloc] initWithNibName:@"HistoryOrCatalogController" bundle:[NSBundle mainBundle]]; 
hoc.delegate = self; 
UIPopoverController *po = [[UIPopoverController alloc]initWithContentViewController:hoc]; 
po.popoverContentSize = CGSizeMake(200.0, 90.0); 
[hoc release]; 
self.searchPopover = po; 
[po release]; 

[super viewDidLoad]; 
total = 0.0f; 
qtyAddedToOrder = 0; 
if (iCalledFrom == 1) { 
    UIBarButtonItem *bi = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(back)]autorelease]; 
    [navigationBar.topItem setLeftBarButtonItem:bi animated:YES]; 

} 
NSError *error; 
orderID = orders.OrderID; 
if(![[self fetchedResultsController] performFetch:&error]){ 
    NSLog(@"Order Error: %@, %@", error, [error userInfo]); 
} 
[self updateInterface]; 

self.navigationBar.topItem.title = [NSString stringWithFormat:@"Order # %d", [orders.OrderID intValue]]; 


} 

는 사람이 올바른 방향으로 날 포인트? 어떤 이유로 내 컨텍스트가 부모에게 속한 것이라고 생각할 수 있지만 잘 모르겠습니다. 내 머리카락을 꺼내!

+0

이유는 확실하지 않지만 문제는 프로그램 시작부터 실제 managedobjectcontext에있는 것처럼 보입니다. 나는 통과하여 [managedObjectContext release]를 추가했다. managedObjectContext = nil; [dealloc]에서 길을 따라 가고 그것은 그것을 (지금 당장) 치유 한 것으로 보인다. 왜? 모르겠다. . . –

+1

나머지 코드는 모르지만 똑같은 문제가있었습니다. 엔터티가 채워진 UITableView입니다. 무엇이 (분명히) 테이블보기에서 레코드를 선택하고 세부 뷰 컨트롤러에 매개 변수로 NSManagedObject 엔터티를 전달하여 문제를 일으켰습니다. 대신 NSManagedObjectID 전달하고 저장소에서 개체를 가져 오는 해결했습니다. – Leonardo

답변

17
저도 같은 문제에 직면 것으로, 하나의 하드 쓸모 디버그 후, 나는 효과적인 솔루션을 여기에 게시물을 발견

: http://tinymission.com/blog/blogengine.web/post/2011/03/04/NSFetchedResultsController-and-EXC_BAD_ACCESS.aspx

인용구 : 코어 데이터 프로그래밍 내에서 깊이 묻혀

안내를 간단한 해결책 은 보기가 사라진 후에 항상 fetchedResultsController를 nil로 설정해야합니다. 나는 dealloc 함수에서 그것을 풀어 놓았지만, 은 충분하지 않았습니다 - 그것을 nil로 설정할 필요가 있습니다. 바로 이 nil로 설정되도록하려면 viewWillDisappear를 구현하고 거기에 코드를 넣으십시오. 문제 해결됨!

PS (내가 팁을! 찾는없이 읽을 수있는 시간을 잃은 이후)

-(void)viewWillDisappear:(BOOL)animated { 
self.fetchedResultsController = nil; 
} 

어쨌든 나는 사과 문서에 대한 URL을 요청 댓글을 쓰셨습니다. 내 코드에서 [super viewWillDisappear : animated]에 대한 호출을 추가했습니다. : P

+0

나는 또한 Alan과 같은 문제를 겪고 있었고, 귀하의 게시물은 해결책을 찾는데 도움이되었습니다. 감사! – Marcin

+0

Woot! 이것은 도움이되었습니다. 또한 의미가 있습니다. –

+0

굉장! 내 문제를 해결 한 훌륭한 대답. – Convolution

9

fetchedResultsController를 nil로 설정하는 대신 delegate를 nil로 설정하십시오. 그것은 controllerWillChangeContent를 호출하고 충돌을 일으키는 대리자입니다.

보기가 숨겨지면 대리자를 직접 제거하고 표시되면 다시 추가합니다.

- (void)viewWillAppear:(BOOL)animated { 
    [super viewWillAppear:animated]; 

    // Start listening for updates when visable 
    self.fetchedResultsController.delegate = self; 
} 

- (void)viewWillDisappear:(BOOL)animated { 
    [super viewWillDisappear:animated]; 

    // Stop listening for updates when not visable 
    self.fetchedResultsController.delegate = nil; 
} 
2

나는 확실히 여기에서 볼 응용 프로그램의 구조를 충분히 거기 확실하지 않다 그러나 이것은 위임 패턴과 메모리 관리, NSFetchedResultsController에 국한되지 아무것도 일반적인 문제처럼 들린다.

일반적인 문제 으로 나타납니다. 여기서 개체 A는 개체 B에 대한 대리자이고 개체 A는 할당이 취소되었지만 B는이를 알지 못합니다. B는 A에게 메시지를 보내려고 계속 노력합니다. 이로 인해 message sent to deallocated instance 오류가 발생하고 충돌이 발생합니다. 이 경우 B는 NSFetchedResultsController이지만 위임을 사용하는 모든 클래스의 인스턴스가 될 수 있습니다. NSURLConnection과 비슷한 문제가 발생했습니다.

다른 답변은 다른 방법으로 충돌을 피합니다. @property 선언이 올바른 가정

self.fetchedResultsController = nil; 

작품을 사용하기 때문에, 상기 결과 페치 컨트롤러를 해제한다. 이것은 아마도 올바른 해결책 일 수 있지만 다시 전체적인 앱 구조에 달려 있습니다.

self.fetchedResultsController.delegate = nil 

사용

충돌을 피할 수 있지만 가져온 결과 컨트롤러 할당을 해제하지 않습니다. 이것은 응용 프로그램이 충돌하는 것을 막아 주지만 아마도 메모리 누수로 연결됩니다. 어딘가에는 대화 할 담당자가없고 정보를 묻는 사람이없는 누출 된 가져온 결과 컨트롤러가 있습니다. 위의 설명에서 B는 여전히 존재하지만 대리인이 nil이므로 더 이상 할당 해제 된 A에게 메시지를 보내려고 시도하지 않습니다.

+0

감사합니다. Tom! 조금 더 파고 들자 마자 ARC가 반출 된 결과 컨트롤러를 할당 해제한다는 것을 알게되었지만 대리인을 제외시키는 것은 여전히 ​​내 책임입니다. fetchedResultsController.delegate = nil로 dealloc 추가하기 이 문제를 해결했습니다. 나는 dealloc을 구현 한 것으로 생각했지만, 그렇지는 않다고 생각합니다. - \ –

+0

@PhilipLoden Thanks. dealloc과 fetchedResultsController = nil을 추가하면 내 문제가 해결되었습니다. 나는 반나절을 조사하고있었습니다. –

관련 문제