Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding a dictionary to a table view



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.