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 (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to