Binding a dictionary to a table view
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:22:44 +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