• 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
Binding a dictionary to a table view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding a dictionary to a table view


  • Subject: Binding a dictionary to a table view
  • From: Stefan Fisk <email@hidden>
  • Date: Sun, 30 Oct 2005 19:28:55 +0100

Hi once again all!

I've got a dictionary in the defaults database that I'd like to bind a table view with the key names in one column, and the values in another. I've tried using to NSArrayControllers in the following, but it doesn't seem to work.

NSDictionary *defaults = [[NSUserDefaultsController sharedUserDefaultsController] valueForKeyPath:@"values.dictionary"];

NSEnumerator *keyEnumerator = [defaults keyEnumerator];
NSString *key = nil;
while (key = [keyEnumerator nextObject]) {
[keyArrayController insertObject:key atArrangedObjectIndex:0];
[valueArrayController insertObject:[defaults valueForKey:key] atArrangedObjectIndex:0];
}


If anyone's got a solution to my problem I'd love it if they would share it. I've considered making a value transformer, but It seems a bit dodgy.


Best Regards

Stefan Fisk
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Binding a dictionary to a table view
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Binding a dictionary to a table view
  • Next by Date: Re: Possible to show cocoa controls over QCView?
  • Previous by thread: Binding a dictionary to a table view
  • Next by thread: Re: Binding a dictionary to a table view
  • Index(es):
    • Date
    • Thread