Skip navigation.
 
mlRe: When are bound variables initialized?
FROM : Michael Lutz
DATE : Tue Apr 12 22:05:57 2005

Well, I try to initialize it in awakeFromNib: [selectedXAxisValue
setString:@"Distance"];
But at that point of time the Chart window was not displayed the first
time. And so selectedXAxisValue is nil and the setString message has no
effect.
So my question is: When changes the selectedXAxisValue from nil to a
real object? Or do i have to alloc] init] it? I tried it once but I
remember I got some signal error when I released it in AppController's
dealloc method.

Many thanks,
  Michael


On Apr 12, 2005, at 21:34, Kevin Ballard wrote:

> I assume you're setting a value for selectedXAxisValue yourself, yes?
> There are two potential solutions:
>
> 1) Instead of setting it directly, use your setter method. This will
> notify the bound object to update itself
>
> 2) Use [self willChangeValueForKey:@"selectedXAxisValue"] right before
> setting it manually and [self
> didChangeValueForKey:@"selectedXAxisValue"] right after setting it.
> This has the same effect as solution #1.
>
> On Apr 12, 2005, at 2:34 PM, Michael Lutz wrote:
>

>> in one NIB I have two windows: One main and one Chart window. Those
>> two windows are controlled by one 'AppController' class. The Chart
>> window has two radio buttons on it, where the selectedValue is bound
>> to  NSMutableString    *selectedXAxisValue. When I show the Chart
>> window the first time selectedValue is nil and none of the buttons is
>> selected.
>> So my question is: When is selectedValue initialized the first time
>> and how can I initialize it up-front (so one button is selected)?

>
> --
> Kevin Ballard
> <email_removed>
> http://www.tildesoft.com
> http://kevin.sb.org
>

Related mailsAuthorDate
mlWhen are bound variables initialized? Michael Lutz Apr 12, 20:34
mlRe: When are bound variables initialized? Kevin Ballard Apr 12, 21:34
mlRe: When are bound variables initialized? Michael Lutz Apr 12, 22:05
mlRe: When are bound variables initialized? Kevin Ballard Apr 12, 22:11
mlRe: When are bound variables initialized? Michael Lutz Apr 13, 22:21
mlRe: When are bound variables initialized? Scott Anguish Apr 13, 23:38