Re: Cocoa Bindings, NSMatrix, setting programmatically
Re: Cocoa Bindings, NSMatrix, setting programmatically
- Subject: Re: Cocoa Bindings, NSMatrix, setting programmatically
- From: Anthony Byrne <email@hidden>
- Date: Wed, 28 Apr 2004 11:07:51 -0500
On Apr 28, 2004, at 10:22 AM, Renaud Boisjoly <email@hidden> wrote:
>
But by default, when I run my app and create a new event, the
>
NSMutableArray called weekdays, is set to NULL, although the NSMatrix
>
has a single day selected. When I click on a day, then, the array is
>
set to contain that day. But when I set the array programmatically,
>
using [self setAllWeekdays:[NSMutableArray arrayWithObject:@"Monday"];
>
the array is set, but the interface doesn't reflect it.
Hi Renaud,
I'm still getting the hang of the bindings, but I had a similar problem
that was solved by manually notifying the array "observer" (i.e. your
controller). Try "bracketing" your array updates with calls to:
willChange:valuesAtIndexes:forKey:
and
didChange:valuesAtIndexes:forKey:.
It may be that your controller just doesn't know that it's source data
has changed. Anyway, that worked for me.
Hope this helps,
Tony Byrne
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.