Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding members to group in Address book



Maybe try adding the group to the book before adding the person?

ABAddressBook*book = [ABAddressBook SharedAddressBook];
ABPerson *person;
ABGroup *group = [[[ABGroup alloc] init] autorelease];
[group setValue:@"friend" forProperty:kABGroupNameProperty];
[book addRecord:group];

person = [[[ABPerson alloc] init] autorelease];
[person setValue:@"john" forProperty:kABFirstNameProperty];
[person setValue:@"ejks' forProperty:kABLastNameProperty];
[book addRecord: person];
[group addMember: person];
[book save];


Hasani
On Jul 18, 2008, at 12:56 AM, Vijay Kanse wrote:

Hello,
I want to add group and members to group in address book.
I have done the following things.
ABAddressBook*book = [ABAddressBook SharedAddressBook];
ABPerson *person;
ABGroup *group = [[[ABGroup alloc] init] autorelease];
[group setValue:@"friend" forProperty:kABGroupNameProperty];
person = [[[ABPerson alloc] init] autorelease];

[person setValue:@"john" forProperty:kABFirstNameProperty];
[person setValue:@"ejks' forProperty:kABLastNameProperty];

[book addRecord: person];

[group addMember: person];

[book addRecord:group];

[book save];

I am not getting the group in address book. addMember and addRecord are
returning value true.
can anyone tell me what is the problem?


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Adding members to group in Address book (From: "Vijay Kanse" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.