/ Published in: Objective C
A database table is basically an array of dictionary objects. As long
as all the fields are valid property list types, you can loop through
the array creating a managed object for each dictionary and setting
the values. If you have an array controller in your nib and it's
configured for your managed object, you can use this (where plist is
expected to be an NSArray* - not sure why I made it an id).
as all the fields are valid property list types, you can loop through
the array creating a managed object for each dictionary and setting
the values. If you have an array controller in your nib and it's
configured for your managed object, you can use this (where plist is
expected to be an NSArray* - not sure why I made it an id).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
controller; { while(dictionaryItem = [oe nextObject]) { [mo setValuesForKeysWithDictionary:dictionaryItem]; [controller addObject:mo]; } }
URL: http://www.cocoabuilder.com/archive/message/cocoa/2006/11/5/173980