Custom Properties in Address Book
Custom Properties in Address Book
- Subject: Custom Properties in Address Book
- From: Antonio Ferraioli <email@hidden>
- Date: Tue, 2 Mar 2004 13:30:11 +0100
I was trying to add a new custom property to all the records
present in the Address Book database
i tried to follow the Address Book References and i wrote the following
code
but it has no effect (it does not crash but the structure of the
address book is not modified)
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
#import <AddressBook/ABAddressBookC.h>
#import <AddressBook/ABGlobalsC.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSMutableDictionary *new = [NSMutableDictionary dictionary];
[new setObject:@"kABStringProperty"
forKey:@"MobileDeviceDescription"];
[ABPerson addPropertiesAndTypes:new];
// [[ABAddressBook sharedAddressBook] save]; // enabling this does
not work too
NSArray *properties = [ABPerson properties];
NSLog(@"properties=%@", properties);
[pool release];
return 0;
}
thank for your help
Antonio
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.