Re: Cococa-Dev : was [coredata count not fulfill fault after object delete]
Re: Cococa-Dev : was [coredata count not fulfill fault after object delete]
- Subject: Re: Cococa-Dev : was [coredata count not fulfill fault after object delete]
- From: Martin Hewitson <email@hidden>
- Date: Sun, 13 Jan 2013 08:29:20 +0100
Now that I know how to get instruments to track retains and releases, I can see what is happening to my entity. I'm still uncertain how to interpret the results, but I see two strange things in the history of the object being deleted:
1) It has a reference count of 3 after all the deletion stuff has finished
2) Whenever I do [NSTreeController selectedObjects] I seem to end with an additional reference count. Is that expected?
In the end, I'm struggling to see if this could be the cause of my "CoreData could not fulfil fault" bug. Since I can't reproduce this on my development machine (10.8) and it only shows up on 10.6.8, it's proving difficult to track down.
Anyone have any other ideas? Or can anyone see the problem in the history of the object dumped below?
Yours in abject frustration,
Martin
# Address Category Event Type RefCt Timestamp Size Responsible Library Responsible Caller
0 0x1031c4bd0 FolderEntity_Folder_ Malloc 1 00:10.760.480 112 CoreData _PFAllocateObject
1 0x1031c4bd0 FolderEntity_Folder_ Retain 2 00:10.760.709 0 CoreData -[NSManagedObjectContext(_NSInternalAdditions) _insertObjectWithGlobalID:globalID:]
2 0x1031c4bd0 FolderEntity_Folder_ Retain 3 00:10.761.328 0 CoreData _sharedIMPL_setvfk_core
3 0x1031c4bd0 FolderEntity_Folder_ Release 2 00:10.761.358 0 CoreData _PF_ManagedObject_DidChangeValueForKeyIndex
4 0x1031c4bd0 FolderEntity_Folder_ Retain 3 00:10.763.708 0 Foundation -[NSObject(NSDelayedPerforming) performSelector:withObject:afterDelay:inModes:]
5 0x1031c4bd0 FolderEntity_Folder_ Retain 4 00:10.763.726 0 TeXnicle -[ProjectItemTreeController addFolder:withFilePath:createOnDisk:]
6 0x1031c4bd0 FolderEntity_Folder_ Release 3 00:10.763.726 0 TeXnicle -[ProjectItemTreeController addFolder:withFilePath:createOnDisk:]
7 0x1031c4bd0 FolderEntity_Folder_ Autorelease 00:10.763.729 0 TeXnicle -[ProjectItemTreeController addFolder:withFilePath:createOnDisk:]
8 0x1031c4bd0 FolderEntity_Folder_ Retain 4 00:10.763.730 0 TeXnicle -[ProjectItemTreeController addNewFolder]
9 0x1031c4bd0 FolderEntity_Folder_ Release 3 00:10.763.730 0 TeXnicle -[ProjectItemTreeController addNewFolder]
10 0x1031c4bd0 FolderEntity_Folder_ Retain 4 00:10.776.907 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processPendingInsertions:withDeletions:withUpdates:]
11 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:10.776.909 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processPendingInsertions:withDeletions:withUpdates:]
12 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:10.776.911 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processPendingInsertions:withDeletions:withUpdates:]
13 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:10.777.108 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:]
14 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:10.777.255 0 AppKit -[_NSManagedProxy _managedObjectsChangedInContext:]
15 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:10.777.315 0 AppKit -[NSTreeController(NSManagedController) _reactToMatchingInsertions:deletions:refreshed:]
16 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:10.777.319 0 AppKit -[NSTreeController(NSManagedController) _reactToMatchingInsertions:deletions:refreshed:]
17 0x1031c4bd0 FolderEntity_Folder_ Retain 9 00:10.777.732 0 Foundation -[NSArray(NSKeyValueSorting) sortedArrayUsingDescriptors:]
18 0x1031c4bd0 FolderEntity_Folder_ Retain 10 00:10.777.846 0 AppKit -[NSTreeNode setRepresentedObject:]
19 0x1031c4bd0 FolderEntity_Folder_ Retain 11 00:10.779.008 0 TeXnicle -[ESOutlineView reloadData]
20 0x1031c4bd0 FolderEntity_Folder_ Release 10 00:10.779.011 0 TeXnicle -[ESOutlineView reloadData]
21 0x1031c4bd0 FolderEntity_Folder_ Release 9 00:10.779.083 0 AppKit -[_NSManagedProxy _managedObjectsChangedInContext:]
22 0x1031c4bd0 FolderEntity_Folder_ Release 8 00:10.779.133 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:]
23 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:10.779.169 0 Foundation -[NSAutoreleasePool drain]
24 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:10.779.178 0 Foundation -[NSAutoreleasePool drain]
25 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:10.779.895 0 Foundation -[NSAutoreleasePool drain]
26 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:10.784.592 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
27 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:10.784.900 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
28 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:10.863.819 0 TeXnicle -[ProjectItemTreeController selectItem:]
29 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:10.863.822 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
30 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:10.864.470 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
31 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:10.864.470 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
32 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:10.864.473 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
33 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:10.866.106 0 AppKit -[NSTreeController selectedObjects]
34 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:10.866.109 0 AppKit -[NSTreeController selectedObjects]
35 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:10.866.111 0 AppKit -[NSTreeController selectedObjects]
36 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:10.867.456 0 TeXnicle -[TeXProjectDocument handleProjectOutlineViewSelectionChange:]
37 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:10.867.458 0 TeXnicle -[TeXProjectDocument handleProjectOutlineViewSelectionChange:]
38 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:10.867.466 0 TeXnicle -[TeXProjectDocument updateStatusView]
39 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:10.867.534 0 TeXnicle -[TeXProjectDocument updateStatusView]
40 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:10.868.053 0 TeXnicle -[ProjectItemTreeController selectItem:]
41 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:10.868.115 0 Foundation __delayedPerformCleanup
42 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:10.872.624 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
43 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:10.872.689 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
44 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:11.693.608 0 TeXnicle -[TeXProjectDocument updateStatusView]
45 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:11.693.732 0 TeXnicle -[TeXProjectDocument updateStatusView]
46 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:12.105.209 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
47 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:12.105.428 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
48 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:12.237.667 0 AppKit -[NSTreeController _selectObjectsAtIndexPathsNoCopy:avoidsEmptySelection:sendObserverNotifications:]
49 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:12.936.571 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
50 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:12.936.638 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
51 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:12.955.016 0 CoreData -[NSManagedObjectContext executeFetchRequest:error:]
52 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:12.955.022 0 CoreData -[NSManagedObjectContext executeFetchRequest:error:]
53 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:12.955.034 0 Foundation -[NSAutoreleasePool drain]
54 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:12.955.047 0 TeXnicle -[ProjectEntity items]
55 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:12.957.075 0 Foundation NSLog
56 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:12.957.084 0 Foundation NSLog
57 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:12.966.605 0 Foundation -[NSArray(NSKeyValueCoding) valueForKey:]
58 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:12.984.347 0 CoreData -[NSManagedObjectContext executeFetchRequest:error:]
59 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:12.984.351 0 CoreData -[NSManagedObjectContext executeFetchRequest:error:]
60 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:12.984.363 0 Foundation -[NSAutoreleasePool drain]
61 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:12.984.375 0 TeXnicle -[ProjectEntity items]
62 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:12.986.154 0 Foundation NSLog
63 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:12.986.158 0 Foundation NSLog
64 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:12.986.250 0 CoreData -[NSManagedObjectContext executeFetchRequest:error:]
65 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:12.986.253 0 CoreData -[NSManagedObjectContext executeFetchRequest:error:]
66 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:12.986.259 0 Foundation -[NSAutoreleasePool drain]
67 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:12.986.265 0 TeXnicle -[ProjectEntity items]
68 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:12.996.524 0 CoreData -[NSMappedObjectStore executeSaveChangesRequest:withContext:]
69 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:12.996.564 0 CoreData -[NSMappedObjectStore executeSaveChangesRequest:withContext:]
70 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:13.006.108 0 CoreData -[NSManagedObjectContext save:]
71 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:13.006.158 0 Foundation -[NSAutoreleasePool drain]
72 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:13.006.212 0 CoreData -[NSManagedObjectContext(_NSInternalAdditions) _didSaveChanges]
73 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:13.006.340 0 CoreData -[NSManagedObjectContext(_NSInternalAdditions) _clearInsertions]
74 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:13.006.425 0 CoreData -[NSManagedObjectContext(_NSInternalAdditions) _didSaveChanges]
75 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:13.033.109 0 Foundation -[NSAutoreleasePool drain]
76 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:13.033.112 0 Foundation -[NSAutoreleasePool drain]
77 0x1031c4bd0 FolderEntity_Folder_ Release 3 00:13.033.337 0 Foundation -[NSAutoreleasePool drain]
78 0x1031c4bd0 FolderEntity_Folder_ Retain 4 00:15.174.828 0 AppKit -[NSTreeController selectedObjects]
79 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:15.174.846 0 AppKit -[NSTreeController selectedObjects]
80 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:15.174.849 0 AppKit -[NSTreeController selectedObjects]
81 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:15.175.738 0 TeXnicle -[TeXProjectDocument handleProjectOutlineViewSelectionChange:]
82 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:15.175.740 0 TeXnicle -[TeXProjectDocument handleProjectOutlineViewSelectionChange:]
83 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:15.175.745 0 TeXnicle -[TeXProjectDocument updateStatusView]
84 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:15.175.854 0 TeXnicle -[TeXProjectDocument updateStatusView]
85 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:15.176.191 0 TeXnicle -[TPOutlineView defaultMenuForRow:]
86 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:15.176.193 0 TeXnicle -[ProjectItemTreeController selectItem:]
87 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:15.176.194 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
88 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:15.176.530 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
89 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:15.176.530 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
90 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:15.176.533 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
91 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:15.177.105 0 AppKit -[NSTreeController _selectObjectsAtIndexPathsNoCopy:avoidsEmptySelection:sendObserverNotifications:]
92 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:15.177.220 0 TeXnicle -[ProjectItemTreeController selectItem:]
93 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:15.227.033 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
94 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:15.227.100 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
95 0x1031c4bd0 FolderEntity_Folder_ Release 3 00:16.907.014 0 TeXnicle -[TPOutlineView removeItem:]
96 0x1031c4bd0 FolderEntity_Folder_ Retain 4 00:16.932.178 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
97 0x1031c4bd0 FolderEntity_Folder_ Release 3 00:16.932.285 0 TeXnicle -[ProjectItemTreeController outlineView:willDisplayCell:forTableColumn:item:]
98 0x1031c4bd0 FolderEntity_Folder_ Retain 4 00:16.962.115 0 AppKit -[NSTreeController selectedObjects]
99 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:16.962.118 0 AppKit -[NSTreeController selectedObjects]
100 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:16.962.120 0 AppKit -[NSTreeController selectedObjects]
101 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:16.962.125 0 TeXnicle -[TeXProjectDocument updateStatusView]
102 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:16.962.187 0 TeXnicle -[TeXProjectDocument updateStatusView]
103 0x1031c4bd0 FolderEntity_Folder_ Retain 5 00:17.469.725 0 TeXnicle -[ProjectItemTreeController removeItemsInFolder:]
104 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:17.469.735 0 TeXnicle -[ProjectItemTreeController removeItemsInFolder:]
105 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:17.469.770 0 TeXnicle -[TeXProjectDocument handleProjectItemEntityWasRemovedNotification:]
106 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:17.470.639 0 TeXnicle -[TeXProjectDocument handleProjectItemEntityWasRemovedNotification:]
107 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:17.472.509 0 TeXnicle -[ProjectItemTreeController removeItemsInFolder:]
108 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:17.473.280 0 TeXnicle -[NSTreeController(ESExtensions) indexPathToObject:]
109 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:17.473.281 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
110 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:17.473.540 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
111 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:17.473.540 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
112 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:17.473.543 0 TeXnicle -[NSTreeController(ESExtensions) treeNodeForObject:]
113 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:17.473.552 0 TeXnicle -[NSTreeController(ESExtensions) indexPathToObject:]
114 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:17.473.570 0 AppKit -[NSTreeController _removeObjectsAtArrangedObjectIndexPaths:objectHandler:]
115 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:17.474.023 0 AppKit -[NSTreeControllerTreeNode removeObjectFromSubNodesAtIndex:]
116 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:17.474.024 0 AppKit -[NSTreeControllerTreeNode removeObjectFromSubNodesAtIndex:]
117 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:17.474.025 0 AppKit -[NSTreeControllerTreeNode removeObjectFromSubNodesAtIndex:]
118 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:17.474.178 0 CoreData -[NSManagedObjectContext deleteObject:]
119 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:17.474.197 0 AppKit -[NSTreeController _removeObjectsAtArrangedObjectIndexPaths:objectHandler:]
120 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:17.475.095 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _propagateDeletesUsingTable:]
121 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:17.475.096 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _propagateDeletesUsingTable:]
122 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:17.475.193 0 CoreData -[NSManagedObject(_NSInternalMethods) _excludeObject:fromPropertyWithKey:andIndex:]
123 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:17.475.235 0 CoreData -[NSManagedObject(_NSInternalMethods) _excludeObject:fromPropertyWithKey:andIndex:]
124 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:17.475.241 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _propagateDeletesUsingTable:]
125 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:17.475.243 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _propagateDeletesUsingTable:]
126 0x1031c4bd0 FolderEntity_Folder_ Retain 6 00:17.475.283 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processPendingDeletions:withInsertions:withUpdates:withNewlyForgottenList:withRemovedChangedObjects:]
127 0x1031c4bd0 FolderEntity_Folder_ Retain 7 00:17.475.284 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processPendingDeletions:withInsertions:withUpdates:withNewlyForgottenList:withRemovedChangedObjects:]
128 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:17.475.287 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processPendingDeletions:withInsertions:withUpdates:withNewlyForgottenList:withRemovedChangedObjects:]
129 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:17.475.474 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:]
130 0x1031c4bd0 FolderEntity_Folder_ Retain 8 00:17.475.579 0 AppKit -[_NSManagedProxy _managedObjectsChangedInContext:]
131 0x1031c4bd0 FolderEntity_Folder_ Release 7 00:17.475.589 0 AppKit -[_NSManagedProxy _managedObjectsChangedInContext:]
132 0x1031c4bd0 FolderEntity_Folder_ Release 6 00:17.475.632 0 CoreData -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:]
133 0x1031c4bd0 FolderEntity_Folder_ Release 5 00:17.475.788 0 TeXnicle -[ProjectItemTreeController removeItemsAlertEnded:code:context:]
134 0x1031c4bd0 FolderEntity_Folder_ Release 4 00:17.714.616 0 AppKit -[NSTreeNode dealloc]
135 0x1031c4bd0 FolderEntity_Folder_ Release 3 00:17.714.623 0 Foundation -[NSAutoreleasePool drain]
On 12, Jan, 2013, at 07:20 AM, Martin Hewitson <email@hidden> wrote:
> OK, I tried with the MOC's undoManager set to nil, but the problem persists. Most annoying. I'll keep digging and post back if I discover anything.
>
> Martin
>
> On 10, Jan, 2013, at 06:46 PM, Peter <email@hidden> wrote:
>
>>
>> Am 10.01.2013 um 18:38 schrieb Martin Hewitson:
>>
>>>
>>> On 10, Jan, 2013, at 06:25 PM, Peter <email@hidden> wrote:
>>>
>>>>
>>>> Am 10.01.2013 um 18:06 schrieb Martin Hewitson:
>>>>
>>>>> And I forgot to mention: the persistent store seems to get saved since when I restart the app (it's unusable after the CoreData error) the removed entities are not present. Curiouser and curiouser.
>>>>>
>>>>> Martin
>>>>>
>>>>>
>>>>>
>>>>> On 10, Jan, 2013, at 06:05 PM, Martin Hewitson <email@hidden> wrote:
>>>>>
>>>>>>
>>>>>> On 9, Jan, 2013, at 04:26 PM, Mike Abdullah <email@hidden> wrote:
>>>>>>
>>>>>>>
>>>>>>> On 8 Jan 2013, at 05:53, Martin Hewitson wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> On Jan 7, 2013, at 08:44 PM, Mike Abdullah <email@hidden> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 7 Jan 2013, at 16:35, Martin Hewitson <email@hidden> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Francisco,
>>>>>>>>>>
>>>>>>>>>> Thanks for the feedback!
>>>>>>>>>>
>>>>>>>>>> What you suggest sounds like it might fix the problem, but I'm wondering how best to do this. Currently I'm just calling -remove: on the tree controller to delete the selected object(s). Of course, if I clear the selection first, then -remove: doesn't do anything. I can grab an array of the selected objects before clearing the selection then use NSManagedObjectContext's -deleteObject:. So something like this:
>>>>>>>>>>
>>>>>>>>>> // get a pointer to the selected items
>>>>>>>>>> NSArray *items = [self selectedObjects];
>>>>>>>>>>
>>>>>>>>>> // clear selection
>>>>>>>>>> [self setSelectionIndexPaths:@[]];
>>>>>>>>>>
>>>>>>>>>> // now delete from the MOC
>>>>>>>>>> for (NSManagedObject *item in items) {
>>>>>>>>>> [self.managedObjectContext deleteObject:item];
>>>>>>>>>> [self.managedObjectContext processPendingChanges];
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> Does that look sensible to you?
>>>>>>>>>
>>>>>>>>> Why are you calling -processPendingChanges at each iteration of the loop? Calling it yourself is rarely needed, and best done only with justification.
>>>>>>>>>
>>>>>>>>
>>>>>>>> I read in that thread that I referenced (I think) that it may be necessary to do this to avoid/handle objects being deleted twice (if a parent and child are selected, then deleted). To be honest, I'm just trying things to see what works. Since this problem only occurs on 10.6.8, I think I'm looking for a work-around.
>>>>>>>
>>>>>>> Hmm. In my case I go to some lengths to figure out which objects don't need to be deleted, because an ancestor has already been deleted. It does seem simpler your way.
>>>>>>>
>>>>>>> I wonder though — I don't believe there is any harm in asking Core Data to delete an object that's already been marked for deletion. And indeed, you code is doing that. The difference the -processPendingChanges call makes is that handling the delete rule will happen during that call, so child objects are already marked for deletion.
>>>>>>>
>>>>>>
>>>>>> However, I'm still not able to get this to work on 10.6.8. Having the -processPendingChanges call seems to make no difference.
>>>>>>
>>>>>> The code I currently have in my -remove: method of the NSTreeController subclass is
>>>>>>
>>>>>> // get a pointer to the selected items
>>>>>> NSArray *items = [self selectedObjects];
>>>>>>
>>>>>> // clear selection
>>>>>> [self.outlineView selectRowIndexes:[NSIndexSet indexSet] byExtendingSelection:NO];
>>>>>> [self setSelectionIndexPaths:@[]];
>>>>>>
>>>>>> // now from the MOC
>>>>>> for (NSManagedObject *item in items) {
>>>>>> [self removeObjectAtArrangedObjectIndexPath:[self indexPathToObject:item]];
>>>>>> [self.managedObjectContext deleteObject:item];
>>>>>> [self.managedObjectContext processPendingChanges];
>>>>>> }
>>>>>>
>>>>>> (-indexPathToObject: comes from a category NSTreeController_Extensions.h from Jonathan Dann)
>>>>>>
>>>>>> Despite this, I must still have a reference to a deleted object somewhere, but I've no idea where.
>>>>
>>>> What about the undo manager - if you are using undo?
>>>
>>> I think the MOC handles its own undo manager, right? At least I'm not doing handling it myself and I can undo the deletions. But surely the MOC will take care of deletion and undo properly, won't it?
>>
>> Im am not sure what happens under which condition in CoreData under 10.6.8. I had a similar issue with an array controller involved. Maybe you should try setting it to nil and see if the problem persists.
>>
>>> Martin
>>>
>>>>
>>>>>> Could there be other reasons for getting the "CodeData could not fulfull a fault" error?
>>>>>>
>>>>>> Best wishes,
>>>>>>
>>>>>> Martin
>>>>>>
>
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden