开发者

ABGroupAddMember returns false. Why?

When I call ABRecordRef aRecord = ABPersonCreate(), ABGroupAddMember() returns YES.

But when I use ABNewPersonViewController

- (void)newPersonViewController:(ABNewPersonViewController *)new开发者_高级运维PersonViewController didCompleteWithNewPerson:(ABRecordRef)person

And use the (ABRecordRef)person to ABGroupAddMember(), it returns NO.

Why?


Set the addressBook property of the ABNewPersonViewController to the address book reference, which you use to retrieve the group reference.
If you don't set the addressBook property before the ABNewPersonViewController is displayed, then it will create its own address book reference and the ABGroupAddMember function will not work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜