FROM : Trent Jacobs
DATE : Mon May 19 09:40:19 2008
Thanks, I'll give that a try and post here if I'm successful or not.
Cheers.
Scott Stevenson wrote:
>
> On May 15, 2008, at 2:10 PM, Trent Jacobs wrote:
>
>> What I need to do is get the NSTextView to know to reload the
>> attribute from my managed object when the checkbox changes. in other
>> words, it must know to refresh the data in Attribute X even though
>> the data in Attribute X hasn't changed.
>
> The common solution to this is to bind the checkbox to the controller
> with a key like "shouldDisplayAsFormatted" and implement these methods
> in the controller:
>
> - (BOOL)shouldDisplayAsFormatted;
> - (void)setShouldDisplayAsFormatted:(BOOL)newValue;
>
> Or even better, with Objective-C 2.0 syntax:
>
> @property BOOL shouldDisplayAsFormatted;
>
> Inside the "-setShouldDisplayAsFormatted:", method, you use the input
> value to update the display of the NSTextField (which should be an
> IBOutlet).
>
> This is not the only way to do it, but I think it's the easiest and
> cleanest way to do what you want. You probably don't want to bind the
> checkbox to the Managed Object itself because the checkbox affects a
> view on the data, not the data itself.
>
>
> Hope that helps,
>
> - Scott
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
DATE : Mon May 19 09:40:19 2008
Thanks, I'll give that a try and post here if I'm successful or not.
Cheers.
Scott Stevenson wrote:
>
> On May 15, 2008, at 2:10 PM, Trent Jacobs wrote:
>
>> What I need to do is get the NSTextView to know to reload the
>> attribute from my managed object when the checkbox changes. in other
>> words, it must know to refresh the data in Attribute X even though
>> the data in Attribute X hasn't changed.
>
> The common solution to this is to bind the checkbox to the controller
> with a key like "shouldDisplayAsFormatted" and implement these methods
> in the controller:
>
> - (BOOL)shouldDisplayAsFormatted;
> - (void)setShouldDisplayAsFormatted:(BOOL)newValue;
>
> Or even better, with Objective-C 2.0 syntax:
>
> @property BOOL shouldDisplayAsFormatted;
>
> Inside the "-setShouldDisplayAsFormatted:", method, you use the input
> value to update the display of the NSTextField (which should be an
> IBOutlet).
>
> This is not the only way to do it, but I think it's the easiest and
> cleanest way to do what you want. You probably don't want to bind the
> checkbox to the Managed Object itself because the checkbox affects a
> view on the data, not the data itself.
>
>
> Hope that helps,
>
> - Scott
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev






Cocoa mail archive

