ABPerson does not have interface properties ?
ABPerson does not have interface properties ?
- Subject: ABPerson does not have interface properties ?
- From: Erik Stainsby <email@hidden>
- Date: Sat, 14 Jul 2012 19:01:40 -0700
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- [d] Number of people records loaded: %lu", __PRETTY_FUNCTION__, __LINE__, [[peopleArrayController content] count]);
}
@end
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden