我想获取iOS Xamarin中的所有联系人记录。 我使用的代码 - >https://developer.xamarin.com/recipes/ios/shared_resources/contacts/find_a_contact/如何获取ios中的所有联系人记录xamarin
代码:
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);
}
错误代码:
This Error: Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: +[CNContact predicateForContactsMatchingName:]: unrecognized selector sent to class 0x1a3e1ec
我已经添加[Export("predicateForContactsMatchingName:")]
,但它并没有帮助。
无法重现的需要。 –