Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why aren't my bindings firing?



On Mon, Jun 30, 2008 at 5:04 PM, Hamish Allan <email@hidden> wrote:
> On Mon, Jun 30, 2008 at 3:56 PM, Michael Ash <email@hidden> wrote:
>
>> Although Apple's sample code shows overriding -bind:... to store
>> information about the new binding, it doesn't look like this is
>> necessary. You can simply use -infoForBinding: to obtain the info
>> dictionary, extract the bound object and key, and use that information
>> to update the model object. I'd assume this is what the Apple classes
>> do, and it seems to me to be a lot simpler than overriding -bind:...
>> to stash away a bunch of information that's already being stored for
>> you anyway.
>
> That would seem a pretty reasonable assumption, but it doesn't seem to
> be the case. At least, breakpoints on -[NSTextField infoForBinding:],
> -[NSControl infoForBinding:],  -[NSObject infoForBinding:] don't seem
> to trigger when the text field is edited; nor are messages logged from
> a subclass of NSTextField overriding -infoForBinding:.
>
> Any other ideas, anyone?

Well, this is irrelevant to the question of what *you* should do.
Using -infoForBinding: is simple and it works, so use it.

However, if you're curious about what Apple does, it shouldn't be too
hard to find out. You know one thing that happens reliably: your
model's key is set. So set up a test app, put a breakpoint on the
model's setter, then see what's calling it. The rest should follow
from there.

Mike
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Why aren't my bindings firing? (From: Charles Srstka <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Ken Thomases <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Charles Srstka <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Ken Thomases <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Charles Srstka <email@hidden>)
 >Re: Why aren't my bindings firing? (From: "Hamish Allan" <email@hidden>)
 >Re: Why aren't my bindings firing? (From: Charles Srstka <email@hidden>)
 >Re: Why aren't my bindings firing? (From: "Hamish Allan" <email@hidden>)
 >Re: Why aren't my bindings firing? (From: "Michael Ash" <email@hidden>)
 >Re: Why aren't my bindings firing? (From: "Hamish Allan" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.