【发布时间】:2011-03-23 12:10:45
【问题描述】:
如何在 iPhone 中获取联系人?我需要从 iPhone 联系人中获取所有属性。如何使用 MonoTouch 以编程方式实现?
【问题讨论】:
标签: c# iphone xamarin.ios contacts
如何在 iPhone 中获取联系人?我需要从 iPhone 联系人中获取所有属性。如何使用 MonoTouch 以编程方式实现?
【问题讨论】:
标签: c# iphone xamarin.ios contacts
ABAddressBook iPhoneAddressBook = new ABAddressBook();
ABPerson[] Contacts = iPhoneAddressBook.GetPeople();
foreach (ABPerson item in Contacts) {
ABMultiValue<NSDictionary> Contact = item.GetPhones();
foreach (ABMultiValueEntry<NSDictionary> cont in Contact) {
// cont.Label indicates the type ( home,work,etc)
// get the contact via cont.Value
}
}
【讨论】:
【讨论】: