【发布时间】:2017-04-04 11:37:13
【问题描述】:
我想获取 iOS Xamarin 中的所有联系人记录。 我使用了代码 --> https://developer.xamarin.com/recipes/ios/shared_resources/contacts/find_a_contact/
代码:
public override void ViewDidLoad()
{
base.ViewDidLoad();
Util.CurrentView = this;
_View = this;
var predicate = CNContact.GetPredicateForContacts("Appleseed");
var fetchKeys = new NSString[] { CNContactKey.GivenName, CNContactKey.FamilyName };
var store = new CNContactStore();
NSError error;
var contacts = store.GetUnifiedContacts(predicate, fetchKeys, out error);
}
错误代码:
此错误:Foundation.MonoTouchException:Objective-C 异常 抛出。名称:NSInvalidArgumentException 原因:+[CNContact predicateForContactsMatchingName:]: 无法识别的选择器发送到 类 0x1a3e1ec
我已经添加了[Export("predicateForContactsMatchingName:")],但没有帮助。
【问题讨论】:
-
无法复制。