• 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: Problems loading data into NSTableView using a NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems loading data into NSTableView using a NSArrayController


  • Subject: Re: Problems loading data into NSTableView using a NSArrayController
  • From: Shawn Erickson <email@hidden>
  • Date: Tue, 25 Sep 2007 19:26:36 -0700


On Sep 25, 2007, at 7:02 PM, deepak gopal wrote:

Hi

I am using NSArrayController to load two columns of a table View and the method I am using is:

NSArrayController *tableViewController_;

- (void)loadArrayController {

// kPlistPath is the path to the plist file I am using. It has 100 Key-Value Pairs
NSDictionary *plistDictionary = [NSDictionary dictionaryWithContentsOfFile:kPlistPath];


NSMutableDictionary *newDictionary = [NSMutableDictionary dictionary];

[newDictionary setValue:[plistDictionary allKeys] forKey:@"Methods"];

[newDictionary setValue:[plistDictionary allValues] forKey:@"Address"];

  [tableViewController_ addObject:newDictionary];

}

I have till now managed to get a braket in each column.
What am I doing wrong?

NSArrayControllers work on arrays not on dictionaries. Likely want you want to do is create an array of dictionaries with each dictionary having a "Method" key with related value (a single value) and an "Address" key with related value (a single value). Then set that dictionary as the content of array controller.


or how else should I do this?

I suggest you not try to use the controller layer stuff just yet. You can easily does this using a data source and the data structure I outlined.


-Shawn
_______________________________________________

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: 
 >Problems loading data into NSTableView using a NSArrayController (From: deepak gopal <email@hidden>)

  • Prev by Date: Re: Convenience Methods
  • Next by Date: Re: Convenience Methods
  • Previous by thread: Problems loading data into NSTableView using a NSArrayController
  • Next by thread: NSMenuItem: setState not working as expected
  • Index(es):
    • Date
    • Thread