My mistake. 'properties' is a class method, returning the keys; not an instance method, as I was using it below.
On 2012-07-14, at 7:01 PM, Erik Stainsby <[email protected]> wrote: > This one has to be pretty simple. > There is a category of ABPerson which provides this interface. So what have I > missed ? > OSX, 10.7 > > > #import "RSAppDelegate.h" > #import <AddressBook/AddressBook.h> > #import <AddressBook/ABPerson.h> > > @implementation RSAppDelegate > > - (void)applicationDidFinishLaunching:(NSNotification *) notification { > > addressBook = [ABAddressBook addressBook]; > // this line works and loads 81 records into the content array... > // [peopleArrayController setContent:[addressBook people]]; > > > for(ABPerson * person in [addressBook people]) { > > NSArray * props = [person properties]; // No visible > @interface for 'ABPerson' declares the selector 'properties' > > NSMutableDictionary * d = [[NSMutableDictionary alloc] init]; > for( NSString * propName in props ) { > [d setObject:[person valueForProperty:propName] > forKey:propName]; > } > [peopleArrayController addObject:d]; > } > > NSLog(@"%s- [%04d] Number of people records loaded: %lu", > __PRETTY_FUNCTION__, __LINE__, [[peopleArrayController content] count]); > } > > @end _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
