• 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
KVC and addObject for "to-many" properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVC and addObject for "to-many" properties


  • Subject: KVC and addObject for "to-many" properties
  • From: Michael de Haan <email@hidden>
  • Date: Sat, 11 Jul 2009 14:36:51 -0700

Hi all,
There have been quite a few questions about "RaiseMan" in the archives, but none have addressed this and the documentation that I have read does not answer this either, that I can find. :-). After implementing Undo/Redo in the app, where, in a nutshell, the contentArray of an ArrayController is bound to an NSMutableArray of the model. In order to implement UndoRedo, we make use of the "key- value coding to add and remove" (per Hillegass) objects of the Array.


The documentation is clear as to which methods one needs to implement to comply with KVC , but the one that is missing is a simple "addObject", which I assume one is doing when the user clicks the "Create New Employee" button.

The only two methods implemented by Hillegass are the

-insertObject:in<Key>AtIndex:index;
- (void)removeObjectFrom<Key>AtIndex:(NSUInteger)index;




In order to do this then, does Cocoa simply obtain a count of the array( behind the scenes, so to say, even if this method is not implemented), then use


-insertObject:in<Key>AtIndex:Count  ?

Thanks for your indulgence.






_______________________________________________

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


  • Follow-Ups:
    • Re: KVC and addObject for "to-many" properties
      • From: Quincey Morris <email@hidden>
    • Re: KVC and addObject for "to-many" properties
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: [Offtopic] XCode question: Quickly jump to a particular symbol/selector/class ?
  • Next by Date: NSScrollView
  • Previous by thread: Re: Core Data "commit changes" -- What does that mean?
  • Next by thread: Re: KVC and addObject for "to-many" properties
  • Index(es):
    • Date
    • Thread