Re: Adding a people to the system AddressBook
Re: Adding a people to the system AddressBook
- Subject: Re: Adding a people to the system AddressBook
- From: Jeff LaMarche <email@hidden>
- Date: Wed, 28 Jan 2004 10:52:31 -0500
Did you look at the AddressBook reference for Objective-C?
It's located at:
http://developer.apple.com/documentation/UserExperience/Reference/
AddressBook/ObjC_classic/index.html#//apple_ref/doc/uid/20001692
I haven't worked with it, but it looks like it would be a simple matter
of creating a new ABPerson, getting the shared address book instance,
and adding the person to it, something like (this is entirely untested
code):
ABPerson *person = [[ABPerson alloc] init];
[person setValue:@"Smith" forProperty:kABLastNameProperty];
[person setValue:@"Mary" forProperty:kABFirstNameProperty];
[person setValue:@"email@hidden" forProperty:kABEmailProperty];
[person setValue:@"Apple Computer, Inc."
forProperty:kABOrganizationProperty];
[[ABAddressBook sharedAddressBook] addRecord:person];
[[ABAddressBook sharedAddressBook] save];
[person release];
The Cocoa docs have really gotten pretty good - a lot of questions like
this can really be answered by doing a little research.
Jeff
On Jan 28, 2004, at 9:32 AM, malcom wrote:
I would to add a people to my address book via objc+AB API.
The required data are name,surname,email and company.
Anyone have a little example?
THx
daniele
_______________________________________________
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.
_______________________________________________
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.