Re: Core Data _NSFaultingMutableSet Exception

2009-12-22 Thread Gerriet M. Denkmann

On 22 Dec 2009, at 16:20, Jerry Krinock je...@ieee.org wrote:

 On 2009 Dec 21, at 21:05, Gerriet M. Denkmann wrote:
 
 But when I use:
 [ arrayController1 setFilterPredicate: aValue BEGINSWITH[n] a AND ANY 
 theBs.bValue == xx];
 I get an exeption:
 
 HIToolbox: ignoring exception '[_NSFaultingMutableSet 0x1001f5d00 
 addObserver:forKeyPath:options:context:] is not supported. Key path: bValue' 
 that raised inside Carbon event dispatch
 
 I believe I've seen this message when I try to observe the many end of a 
 to-many relation using KVO.  That's against the law.  (And I do remember 
 reading that one in the documentation, mmalc!)  Probably it was in the KVO 
 Programming guide??
 
 Bindings uses KVO.  Clue: Look at any bindings hanging on that array 
 controller.

Well, this was an idea I had already. Because the old (working) app did just 
have an array controller, but the new app (the one throwing exceptions) had 
another array controller bound to the selection of the first one.

So I did [ secondArrayController unbind: @contentSet ] - but no success.
Then I removed the secondArrayController from the nib - no success either.

Now, after reading your mail, I deleted the first array controller, dragged a 
new one into the nib - and everything works!

Obviously the old firstArrayController had some memory of having its content 
bound to by some other controller; a memory persisting regardless of this 
binding having been unbound, or the binder having disappeared.

I am not qualified to call this a bug. But it has cost me more than a day of 
pointless struggle.
Is this persistent memory of NSArrayControllers somewhere documented?
And is there a way (programmatically) to clear this unwanted memory?

Thanks for your help!

Kind regards,

Gerriet.

___

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 _NSFaultingMutableSet Exception

2009-12-22 Thread Kyle Sluder
Do you have an old, unfixed version of your nib in version control  
somewhere? (The answer should be yes; if not, you might want to  
reconsider your approach to version control for the sake of your own  
sanity.)


If so, do the same thing you did, confirm that it causes the same  
problem, and send the old and new versions of the nib off to Apple in  
a bug. There have been instances of this before, where objects simply  
weren't written to anticipate a property changing more than once in  
the lifespan of that object. These cases are definitely bugs.


--Kyle Sluder

On Dec 22, 2009, at 7:56 AM, Gerriet M. Denkmann  
gerr...@mdenkmann.de wrote:




On 22 Dec 2009, at 16:20, Jerry Krinock je...@ieee.org wrote:


On 2009 Dec 21, at 21:05, Gerriet M. Denkmann wrote:


But when I use:
[ arrayController1 setFilterPredicate: aValue BEGINSWITH[n] a  
AND ANY theBs.bValue == xx];

I get an exeption:

HIToolbox: ignoring exception '[_NSFaultingMutableSet  
0x1001f5d00 addObserver:forKeyPath:options:context:] is not  
supported. Key path: bValue' that raised inside Carbon event  
dispatch


I believe I've seen this message when I try to observe the many  
end of a to-many relation using KVO.  That's against the law.  (And  
I do remember reading that one in the documentation, mmalc!)   
Probably it was in the KVO Programming guide??


Bindings uses KVO.  Clue: Look at any bindings hanging on that  
array controller.


Well, this was an idea I had already. Because the old (working) app  
did just have an array controller, but the new app (the one throwing  
exceptions) had another array controller bound to the selection of  
the first one.


So I did [ secondArrayController unbind: @contentSet ] - but no  
success.
Then I removed the secondArrayController from the nib - no success  
either.


Now, after reading your mail, I deleted the first array controller,  
dragged a new one into the nib - and everything works!


Obviously the old firstArrayController had some memory of having its  
content bound to by some other controller; a memory persisting  
regardless of this binding having been unbound, or the binder having  
disappeared.


I am not qualified to call this a bug. But it has cost me more than  
a day of pointless struggle.

Is this persistent memory of NSArrayControllers somewhere documented?
And is there a way (programmatically) to clear this unwanted memory?

Thanks for your help!

Kind regards,

Gerriet.

___

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/kyle.sluder%40gmail.com

This email sent to kyle.slu...@gmail.com

___

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


Core Data _NSFaultingMutableSet Exception

2009-12-21 Thread Gerriet M. Denkmann
Core Data model with two entities: A and B.

A has property aValue and a relation theBs to one or more Bs.

B has a property bValue.

Two NSTableViews (tabelView1 and tableView2 ) with each controlled by an 
NSArrayController (arrayController1 and arrayController2).

Everything works fine when I send:
 [ arrayController1 setFilterPredicate: aValue BEGINSWITH[n] a];
 [ arrayController2 setFilterPredicate: aValue containsInside: a];
(Well, I do send real predicates, but they contain the strings shown above. 
containsInside: is declared in a category on NSString)

But when I use:
 [ arrayController1 setFilterPredicate: aValue BEGINSWITH[n] a AND ANY 
theBs.bValue == xx];
I get an exeption:

 HIToolbox: ignoring exception '[_NSFaultingMutableSet 0x1001f5d00 
addObserver:forKeyPath:options:context:] is not supported. Key path: bValue' 
that raised inside Carbon event dispatch

When later I reset the filterPredicates back to the simple (working) mode, I 
get another exception:
 HIToolbox: ignoring exception 'Cannot remove an observer arrayController1 
for the key path theBs.bValue from A-entity 0x114f02a10 because it is not 
registered as an observer.' that raised inside Carbon event dispatch

1. This is a Cocoa document based app, using Core Data. Why this Carbon event 
dispatch. And who is HIToolbox?

2. I have an identical app, which works perfectly.
(Obviously these two apps are NOT identical, but I really cannot find any 
differences. I tried to remove all changes I made to the newer app, but the 
exception remains).

I spend now more than a day chasing this exception. Any hints would be most 
welcome. 10.6.2.


Kind regards,

Gerriet.

___

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 _NSFaultingMutableSet Exception

2009-12-21 Thread Jerry Krinock

On 2009 Dec 21, at 21:05, Gerriet M. Denkmann wrote:

 But when I use:
 [ arrayController1 setFilterPredicate: aValue BEGINSWITH[n] a AND ANY 
 theBs.bValue == xx];
 I get an exeption:
 
 HIToolbox: ignoring exception '[_NSFaultingMutableSet 0x1001f5d00 
 addObserver:forKeyPath:options:context:] is not supported. Key path: bValue' 
 that raised inside Carbon event dispatch

I believe I've seen this message when I try to observe the many end of a 
to-many relation using KVO.  That's against the law.  (And I do remember 
reading that one in the documentation, mmalc!)  Probably it was in the KVO 
Programming guide??

Bindings uses KVO.  Clue: Look at any bindings hanging on that array controller.

 When later I reset the filterPredicates back to the simple (working) mode, I 
 get another exception:
 HIToolbox: ignoring exception 'Cannot remove an observer arrayController1 
 for the key path theBs.bValue from A-entity 0x114f02a10 because it is not 
 registered as an observer.' that raised inside Carbon event dispatch
 
 1. This is a Cocoa document based app, using Core Data. Why this Carbon 
 event dispatch. And who is HIToolbox?

Do not worry about these words.  It is definitely an error you need to deal 
with.  Don't worry about where it came from -- it came from the bowels of the 
Mac OS.  HI probably means Human Interface but knowing that doesn't help 
you at all.

___

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 _NSFaultingMutableSet Exception

2009-12-21 Thread Graham Cox

On 22/12/2009, at 4:05 PM, Gerriet M. Denkmann wrote:

 When later I reset the filterPredicates back to the simple (working) mode, I 
 get another exception:
 HIToolbox: ignoring exception 'Cannot remove an observer arrayController1 
 for the key path theBs.bValue from A-entity 0x114f02a10 because it is not 
 registered as an observer.' that raised inside Carbon event dispatch
 
 1. This is a Cocoa document based app, using Core Data. Why this Carbon 
 event dispatch. And who is HIToolbox?


Cocoa sits atop Carbon. So all this means is that an exception didn't get 
caught until it reached the Carbon layers. I don't think such exceptions were 
previously logged before 10.6, though they undoubtedly did occur.

You need to concentrate on where the exception came from and stop it from being 
raised, not where it ended up getting caught.

--Graham


___

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 _NSFaultingMutableSet Exception

2009-12-21 Thread Gerriet M. Denkmann

On 22 Dec 2009, at 13:38, Graham Cox wrote:

 
 On 22/12/2009, at 4:05 PM, Gerriet M. Denkmann wrote:
 
 When later I reset the filterPredicates back to the simple (working) mode, I 
 get another exception:
 HIToolbox: ignoring exception 'Cannot remove an observer arrayController1 
 for the key path theBs.bValue from A-entity 0x114f02a10 because it is 
 not registered as an observer.' that raised inside Carbon event dispatch
 
 1. This is a Cocoa document based app, using Core Data. Why this Carbon 
 event dispatch. And who is HIToolbox?
 
 
 Cocoa sits atop Carbon. So all this means is that an exception didn't get 
 caught until it reached the Carbon layers. I don't think such exceptions were 
 previously logged before 10.6, though they undoubtedly did occur.
 
 You need to concentrate on where the exception came from and stop it from 
 being raised, not where it ended up getting caught.

Sigh - I had hoped that this Carbon-message would indicate the source of the 
problem - obviously I was wrong.

The backtrace for the first exception '[_NSFaultingMutableSet 0x10048a950 
addObserver:forKeyPath:options:context:] is not supported. Key path: bValue' 
when setting the predicate 'aValue BEGINSWITH[n] a AND ANY theBs.bValue == 
xx' is:

0   CoreFoundation  0x7fff80b73444 
__exceptionPreprocess + 180
1   libobjc.A.dylib 0x7fff854630f3 
objc_exception_throw + 45
2   CoreFoundation  0x7fff80b73267 
+[NSException raise:format:arguments:] + 103
3   CoreFoundation  0x7fff80b731f4 
+[NSException raise:format:] + 148
4   Foundation  0x7fff8343480e 
-[NSSet(NSKeyValueObserverRegistration) 
addObserver:forKeyPath:options:context:] + 116
5   Foundation  0x7fff8335b16d 
-[NSKeyValueNestedProperty object:didAddObservance:recurse:] + 229
6   Foundation  0x7fff83359f3b 
-[NSObject(NSKeyValueObserverRegistration) 
_addObserver:forProperty:options:context:] + 511
7   Foundation  0x7fff833588e0 
-[NSObject(NSKeyValueObserverRegistration) 
addObserver:forKeyPath:options:context:] + 125
8   AppKit  0x7fff8267d92c 
-[_NSModelObservingTracker 
_registerOrUnregister:observerNotificationsForKeyPath:] + 273
9   AppKit  0x7fff82b4c269 
-[_NSModelObservingTracker registerModelKeyPaths:unregisterModelKeyPaths:] + 421
10  AppKit  0x7fff82715d35 
-[NSArrayController _updateAutomaticRearrangementKeysPaths] + 240
11  AppKit  0x7fff8271e5da 
-[NSArrayController _didChangeArrangementCriteriaWithOperationsMask:useBasis:] 
+ 79
12  AppKit  0x7fff8271e18d 
-[NSArrayController setFilterPredicate:] + 1344
13  ไทย Dict Both 3   0x00014d8e 
-[MyDocument(MyDocumentPrivate) newFilters] + 1473

but there is nothing here what helps me answering why the exception was raised 
(although it answers where it came from).

Kind regards,

Gerriet.

___

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