开发者

Add an ABPerson to an ABGroup

开发者 https://www.devze.com 2022-12-24 13:25 出处:网络
I need to create an address book group, then add 10 ABPerson records as group members. This is what I\'m doing:

I need to create an address book group, then add 10 ABPerson records as group members.

This is what I'm doing:

  1. Create the group with ABGroupCreate()
  2. Use ABGroupAddMember() to add a person to the group

The person record is not getting added. I am saving the address bo开发者_JAVA百科ok.

Why doesn't the person get added to the group?


Before a person record can be added to a group, it must already be in the Address Book database. If you need to add a new person record to a group and to the database at the same time, you must first add it to the address book database, save the database, and then add the person record to the group.


You need to do save of group record and save address book before the addmember call

0

精彩评论

暂无评论...
验证码 换一张
取 消