Re: Core Data observer exception in 10.6

2009-08-31 Thread David Sinclair


On Aug 29, 2009, at 18:18:42, Ben Trumbull wrote:

Hard to say without more details, but it does look like a Cocoa  
Bindings bug.  If you could create a new sample project with your  
NIB and your model and reproduce this, and then attach it to a bug  
report, that would be extremely helpful.



Thanks for the reply, Ben.  I've just sent a DTS request for help with  
this.  Follow-up ID "82245382".  I'll submit a bug report if it turns  
out to be an Apple bug instead of mine.


I included this demo project (extracted from the problem app, Narrator):



On running this app, it will automatically open a bundled document  
that demos the exceptions.  You can create a new document to show that  
basic document creation works fine.  Saving also works.  It's loading  
documents that fails (loading documents from previous versions (with  
no model changes) or from this version both fail.


--

David Sinclair, Dejal Systems, LLC - d...@dejal.com
Dejal blog - http://www.dejal.com/blog/
Cocoa code - http://www.dejal.com/developer/
Twitter - http://twitter.com/dejal/






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


re: Core Data observer exception in 10.6

2009-08-29 Thread Ben Trumbull

In a Core Data-based app that works fine in 10.5.x, I now get an
exception as follows in 10.6 when opening a document.  It targets
10.5, and the same exception occurs when rebuilding on 10.6 (still
targeting 10.5, but also when targeting 10.6).

I don't register or unregister any observers myself, and the exception
occurs without touching any of my code.  What's going on?


NSRangeException: Cannot remove an observer  for the key path "richText" from 
because it is not registered as an observer.
 1	+[NSException raise:format:arguments:] (in CoreFoundation) +  
136

 2  +[NSException raise:format:] (in CoreFoundation) + 58
 3  -[NSObject(NSKeyValueObserverRegistration)
_removeObserver:forProperty:] (in Foundation) + 765
 4  -[NSObject(NSKeyValueObserverRegistration)
removeObserver:forKeyPath:] (in Foundation) + 176
 5  -[NSKeyValueNestedProperty
object:didRemoveObservance:recurse:] (in Foundation) + 544
 6  -[NSObject(NSKeyValueObserverRegistration)
_removeObserver:forProperty:] (in Foundation) + 453
 7  -[NSObject(NSKeyValueObserverRegistration)
removeObserver:forKeyPath:] (in Foundation) + 176
 8  -[_NSModelObservingTracker
_registerOrUnregister:observerNotificationsForModelObject:] (in
AppKit) + 228
 9  -[_NSModelObservingTracker clearAllModelObjectObserving] (in
AppKit) + 341
10  -[_NSModelObservingTracker
setIndexReferenceModelObjectArray:clearAllModelObjectObserving:] (in
AppKit) + 51
11  -[NSArrayController _setObjects:] (in AppKit) + 196
12  -[NSArrayController
_arrangeObjectsWithSelectedObjects:avoidsEmptySelection:operationsMask:useBasis
:] (in AppKit) + 510
13  -[NSArrayController rearrangeObjects] (in AppKit) + 133
14  -[NSArrayController
observeValueForKeyPath:ofObject:change:context:] (in AppKit) + 338
15  NSKeyValueDidChange (in Foundation) + 377
16  -[NSObject(NSKeyValueObservingPrivate)
_didChangeValuesForKeys:] (in Foundation) + 565
17  _PFFaultHandlerFulfillFault (in CoreData) + 1921
18  _PFFaultHandlerLookupRow (in CoreData) + 1573
19  -[NSFaultHandler fulfillFault:withContext:] (in CoreData) + 39
20  _PF_FulfillDeferredFault (in CoreData) + 193
21  _sharedIMPL_pvfk_core (in CoreData) + 65
22  -[NSManagedObject(_PFDynamicAccessorsAndPropertySupport)
_genericValueForKey:withIndex:flags:] (in CoreData) + 79
23  -[NSManagedObject valueForKey:] (in CoreData) + 244
24  -[NSKeyValueNestedProperty object:didAddObservance:recurse:]
(in Foundation) + 240
25  -[NSObject(NSKeyValueObserverRegistration)
_addObserver:forProperty:options:context:] (in Foundation) + 812
26  -[NSObject(NSKeyValueObserverRegistration)
addObserver:forKeyPath:options:context:] (in Foundation) + 565
27  -[_NSModelObservingTracker
_registerOrUnregister:observerNotificationsForKeyPath:ofModelObject:]
(in AppKit) + 134
28  -[_NSModelObservingTracker
_registerOrUnregister:observerNotificationsForModelObject:] (in
AppKit) + 228
29  -[_NSModelObservingTracker _startObservingModelObject:] (in
AppKit) + 418
30  -[_NSModelObservingTracker
startObservingModelObjectsAtReferenceIndexes:] (in AppKit) + 333
31  -[NSArrayController
_arrangeObjectsWithSelectedObjects:avoidsEmptySelection:operationsMask:useBasis
:] (in AppKit) + 510
32  -[NSArrayController setContent:] (in AppKit) + 889
33  -[NSArrayController(NSManagedController)
_performFetchWithRequest:merge:error:] (in AppKit) + 501
34  -[NSObjectController(NSManagedController)
fetchWithRequest:merge:error:] (in AppKit) + 209
35  -[NSObjectController(NSManagedController)
_executeFetch:didCommitSuccessfully:actionSender:] (in AppKit) + 106
36  _NSSendCommitEditingSelector (in AppKit) + 339
37  -[NSController _controllerEditor:didCommit:contextInfo:] (in
AppKit) + 216
38  __invoking___ (in CoreFoundation) + 29
39  -[NSInvocation invoke] (in CoreFoundation) + 136
40  -[NSInvocation invokeWithTarget:] (in CoreFoundation) + 72
41  __NSFireDelayedPerform (in Foundation) + 537
42  __CFRunLoopRun (in CoreFoundation) + 6846


Hard to say without more details, but it does look like a Cocoa  
Bindings bug.  If you could create a new sample project with your NIB  
and your model and reproduce this, and then attach it to a bug report,  
that would be extremely helpful.


Thanks,

- Ben



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Core Data observer exception in 10.6

2009-08-29 Thread David Sinclair


On Aug 29, 2009, at 14:35:23, Kyle Sluder wrote:


On Aug 29, 2009, at 1:48 PM, David Sinclair  wrote:

In a Core Data-based app that works fine in 10.5.x, I now get an  
exception as follows in 10.6 when opening a document.  It targets  
10.5, and the same exception occurs when rebuilding on 10.6 (still  
targeting 10.5, but also when targeting 10.6).


There is an active thread going about this exception *right now.*  
Did you check the list archives before posting? The answer is also  
in the 10.6 release notes, did you read those?


Thanks for the reply.  Are you referring to the "Get error message  
about registered observers when Object receives dealloc message"  
thread?  I did see that, but it didn't seem to be the same issue, as  
far as I could tell.  Perhaps I'm mistaken, though, since I don't  
really know what the issue is.


I haven't had time to read the 10.6 release notes in detail yet, but  
did search for likely areas.  Can you point me to the specific  
document and section?


I don't register or unregister any observers myself, and the  
exception occurs without touching any of my code.  What's going on?


Cocoa Bindings use KVO, and you have no idea if internally Core Data  
(or any other code for that matter) does as well.



Yes, I understand that, I was just pointing out that I couldn't find a  
bug in my code, unless it's a bug of omission.


--

David Sinclair, Dejal Systems, LLC - d...@dejal.com
Dejal blog - http://www.dejal.com/blog/
Cocoa code - http://www.dejal.com/developer/
Twitter - http://twitter.com/dejal/






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Core Data observer exception in 10.6

2009-08-29 Thread Kyle Sluder



--Kyle Sluder

On Aug 29, 2009, at 1:48 PM, David Sinclair  wrote:

In a Core Data-based app that works fine in 10.5.x, I now get an  
exception as follows in 10.6 when opening a document.  It targets  
10.5, and the same exception occurs when rebuilding on 10.6 (still  
targeting 10.5, but also when targeting 10.6).


There is an active thread going about this exception *right now.* Did  
you check the list archives before posting? The answer is also in the  
10.6 release notes, did you read those?


I don't register or unregister any observers myself, and the  
exception occurs without touching any of my code.  What's going on?


Cocoa Bindings use KVO, and you have no idea if internally Core Data  
(or any other code for that matter) does as well.


--Kyle Sluder



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com