我想獲取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:")]
,但它並沒有幫助。
無法重現的需要。 –