• 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
NSArrayController - how?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController - how?


  • Subject: NSArrayController - how?
  • From: William Squires <email@hidden>
  • Date: Fri, 08 Jul 2011 20:16:52 -0500

Here's what I have

plist file -> NSMutableArray of NSDictionary instances

NSDictionary instances all have the same keys, but different values (like a database record)

each NSDictionary maps to another class, RBSStore, that has properties that map to the keys of the NSDictionary's, and that has 2 methods:

-(id)initWithDictionary:(NSDictionary *)aDic;
-(NSDictionary *)storeDictionary;

so that I can go from NSDictionary<->RBSStore. I've got the UI laid out, including the  NSTableView (for displaying the NSDictionarys in the NSMutableArray, NSTextFields for each individual column (so that when you select a row, that row's info shows up in the NSTextField's, and one NSSearchField (not implemented yet.)

Mostly, this is all done via code. How can I transform this into a design that uses bindings and an NSArrayController to eliminate most of the tedious BS, and allow the table view, text fields, and so on to all be linked together so when you update a field, the appropriate row in the table view (and the corresponding NSMutableArray model) all stay in sync?

Mostly, what I don't understand is: what part of the work does the NSArrayController perform? Am I going to need an NSObjectController also to manage the individual rows (which are NSDictionary instances) and their corresponding NSTextFields? The big problem is the docs just describe the programmatic interface to the CoreFoundation classes, but not how to use them in real-world situations, or how to use them within IB.


_______________________________________________

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: NSArrayController - how?
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Why won't iOS app using MKMapView compile?
  • Next by Date: Re: Why won't iOS app using MKMapView compile?
  • Previous by thread: Custom Colors as UITableViewCell background colors
  • Next by thread: Re: NSArrayController - how?
  • Index(es):
    • Date
    • Thread