• 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: Basic NSArrayController NSTableView bindings question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic NSArrayController NSTableView bindings question


  • Subject: Re: Basic NSArrayController NSTableView bindings question
  • From: Ron Lue-Sang <email@hidden>
  • Date: Tue, 23 Aug 2005 11:22:34 -0700

Adding objects to the array doesn't send a KVO notification saying your array changed.

   [myArray addObjectsFromArray:result];

should be

    [self willChangeValueForKey:@"myArray"];
    [myArray addObjectsFromArray:result];
    [self didChangeValueForKey:@"myArray"];

or

[[self mutableArrayValueForKeyPath:@"myArray"] addObjectsFromArray:result];

The mutable array you get from this second option DOES send a KVO notification when it is changed. For cases like this, where the class that owns the ivar is making the change, I prefer option 1.

-----------------------------
Ronzilla
Core Bindings/Cocoa Data


On Aug 23, 2005, at 5:43 AM, email@hidden wrote:

Nothing appears in my table when I run my program, although I know
there is content in the array. I get nothing in the log. My program
fills the array with

   [myArray addObjectsFromArray:result];

where result is an array of MyClass object instances.

Do I have to create accessors in order to use bindings for this? Is
so, what accessors are needed and for what class?

--


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Uniform type identifier support in Cocoa or lack thereof
  • Next by Date: NSLog not logging anymore
  • Previous by thread: Re: Basic NSArrayController NSTableView bindings question
  • Next by thread: NSMutableData short comings?
  • Index(es):
    • Date
    • Thread