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: Simple Cocoa bindings question




On 28 mar 2007, at 03.25, Roland Torres wrote:

Using Cocoa bindings, I have a switch (NSButton) bound to an NSUserDefaultsController. I have the switch's action set to a certain method in my own controller object. This works fine: The switch's state is remembered from invocation to invocation, and when I click on the switch, my action method gets invoked.

But: on startup when the switch's state setting is reconstituted from NSUserDefaultsController as NSOnState, the switch gets drawn with the checkmark, but my action method doesn't get invoked as a result of this. Is there a way to set it so my action method will get invoked if the defaults setting of the switch is the ON state?

Run an if/else in the awakeFromNib method.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Simple Cocoa bindings question (From: Roland Torres <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.