ABGroupAddMember在iOS4设备上不起作用 [英] ABGroupAddMember does not work on iOS4 device

查看:102
本文介绍了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设备上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆