本文介绍了ABGroupAddMember在iOS4设备上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面的代码在Simulator(iOS 4和5)中都可以很好地工作,但是在iOS 4设备上不添加任何联系人。没有错误返回。您知道为什么吗?
the code bellow works great in Simulator (both iOS 4 and 5) but adds no contact on the iOS 4 device. No error is returned. Do you have any idea why?
ABAddressBookRef ab = ABAddressBookCreate(); abGroupRef = ABAddressBookGetGroupWithRecordID(ab, 1); ABRecordRef pRef = ABAddressBookGetPersonWithRecordID(ab, 1); ABGroupAddMember(abGroupRef, pRef, &anError); ABAddressBookSave(ab, &anError);感谢 --Josef
Thanks, --Josef
推荐答案问题是联系人是通过交换与Google同步的。只能有本地组,并且本地组只能容纳本地联系人。这有点公平,但是如果ABGroupAddMember不打算添加成员,则应该返回错误。
The problem was that the contacts were from google synced by exchange. There can be only local groups and local groups may only hold local contacts. This is kinda fair but the ABGroupAddMember should return an error if it is not going to add the member.
更多推荐
ABGroupAddMember在iOS4设备上不起作用
发布评论