Re: Debugging Bindings in Cocoa
Re: Debugging Bindings in Cocoa
- Subject: Re: Debugging Bindings in Cocoa
- From: Gabriele de Simone <email@hidden>
- Date: Tue, 17 Feb 2004 12:47:40 -0500
On Feb 17, 2004, at 12:07 PM, Scott Anguish wrote:
On Feb 17, 2004, at 9:06 AM, Gabriele de Simone wrote:
Often times, when debugging Bindings-code in Cocoa (adding & removing
items) I get this message printed out in my console:
-[_NSStateMarker boolValue]: selector not recognized
It usually takes me a while to find out what the problem is, because
the above message is quite abstract. What does it mean, but more
importantly are there better ways to extract error conditions from
Cocoa?
In general, this message means that you're attempting to send the
boolValue method to something that doesn't implement it. This is more
indicative of a program error (that is, a code issue) rather than an
error condition that the user might encounter.
In this particular case, it looks like you've bound to selection on
something, and when there is a multiple selection you're asking the
boolean value, when if there is a multiple selection you won't get all
the objects, you'll get a Marker instead.
it'd be easier to determine the problem if you showed us some code.
There isn't much source code to show, unfortunately. I implemented
interactive filtering on a NSArrayController using one of the examples
I found on:
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
What happened is that when the controller was being filtered, any
insertion that did not match the filter would fail. I understand that
filtering is a bit of a hack, but it also seems odd that none of the
controller objects posts something like this: "object could not be
inserted". The NSStateMarker warning is a little too late in the chain
of events to make sense of what's happening.
In general, it is also hard to follow what goes on behind the scenes
without the source code of the Cocoa framework (and without meaningful
console messages).
Gabe
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.