Re: ABPerson does not have interface properties ? SOLVED
Re: ABPerson does not have interface properties ? SOLVED
- Subject: Re: ABPerson does not have interface properties ? SOLVED
- From: Erik Stainsby <email@hidden>
- Date: Sat, 14 Jul 2012 19:15:12 -0700
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@hidden> 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- [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