On May 19, 2009, at 21:19:24, Ken Thomases wrote:

On May 19, 2009, at 10:44 PM, Rick Mann wrote:

I have what I think is a very straightforward binding, but I can't verify that it's actually working.

I created a property foo (of type NSCellStateValue, an NSInteger), and bound a checkbox's value to it in IB. To verify that the binding is changing the value, I implemented the getter/setter and put a breakpoint in. It's not stopping at the breakpoint, so I wonder what's going on.

Did you build for debugging? Are breakpoints enabled -- which is another way of asking if you're using Run or Debug from the Run menu?

Can you set a breakpoint in a method you're sure is being called, to verify that breakpoints are working in general?

Have you tried putting an NSLog call into the accessors? Is the log line appearing in Xcode's Console window?

I've done all this, and it behaves as expected. My accessor is even called initially when my code explicitly calls "self.foo = ".

What other tools are there for debugging bindings at this level?

I recommend that you override +accessInstanceVariablesDirectly for all of your classes to return NO. That can catch cases where the binding and instance variables are spelled/typed one way, while the accessors are mistakenly spelled another.

Here's some other info:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/Troubleshooting.html

Thanks!

--
Rick

_______________________________________________

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

Reply via email to