• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa Bindings, NSMatrix, setting programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: Enable Objective-C exception handling. [-fobjc-exceptions] causes additional warnings on pointers?
  • Next by Date: [OT] Box's needed
  • Previous by thread: Re: Cocoa Bindings, NSMatrix, setting programmatically
  • Next by thread: ZeroLink and duplicate symbols
  • Index(es):
    • Date
    • Thread