• 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: How is a bound NSArrayController so stealthy?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How is a bound NSArrayController so stealthy?


  • Subject: Re: How is a bound NSArrayController so stealthy?
  • From: Keary Suska <email@hidden>
  • Date: Tue, 05 Jun 2007 13:10:08 -0600
  • Thread-topic: How is a bound NSArrayController so stealthy?

on 6/5/07 12:38 PM, email@hidden purportedly said:

> How is NSArrayController able to change the model to which it is
> bound so stealthily?  I suppose it could be modifying the instance
> variable directly a la myDocument->toDos?

No stealth involved. When you edit a cell of a tableview, you are editing
the object that represents the row--most commonly an NSDictionary. You are
not editing the array, so none of the array accessors will be called.

> If so, how can I be  notified?  I tried adding self as an observer to key path
> toDos, but  observeValueForKeyPath:ofObject:change:context: does not get
> invoked  when I edit an existing table item.

You need to observe the object that is changing. If you have an NSArray of
NSDicitonaries, you want to observe the dictionaries, not the array. The
array doesn't know that its contained objects are changing. It's not its
business.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How is a bound NSArrayController so stealthy? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Value With Pattern binding not working as expected
  • Next by Date: Re: [CoreData] Background Insertion
  • Previous by thread: How is a bound NSArrayController so stealthy?
  • Next by thread: Re: How is a bound NSArrayController so stealthy?
  • Index(es):
    • Date
    • Thread