• 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 do I know when a new object is added to an NSArray or NSCollectionView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I know when a new object is added to an NSArray or NSCollectionView?


  • Subject: Re: How do I know when a new object is added to an NSArray or NSCollectionView?
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 10 Jan 2010 12:19:57 -0800

On Jan 8, 2010, at 17:02, Brad Stone wrote:

> I'd like a viewController to be notified whenever an arrayController adds a new object.  Here's why:

...

> 1) how do I get notified if a new object is added?

	http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/KeyValueObserving/Concepts/KVOBasics.html

You can observe the "arrangedObjects" property of the array controller, or you can observe the same array property in your data model that your arrayController is bound to (its "contentArray").

> 2) how do I make the NSTextField in the view that just was added ready and waiting to be typed in?

	http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWindow/makeFirstResponder:

All views know what window they're in ([view window]) so it's easy to do both #1 and #2 given just a pointer to the view controller and a pointer to the array controller._______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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 do I know when a new object is added to an NSArray or NSCollectionView? (From: Brad Stone <email@hidden>)

  • Prev by Date: Differentiate FAT16 and FAT32
  • Next by Date: Re: if statement causing 32 Byte leak?
  • Previous by thread: How do I know when a new object is added to an NSArray or NSCollectionView?
  • Next by thread: Supported API for handling bad server certificates in NSURLConnection
  • Index(es):
    • Date
    • Thread