如何在iPhone中获取联系人?我需要从iPhone联系人获取所有属性。如何使用MonoTouch以编程方式实现?
答案 0 :(得分:4)
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
}
}
答案 1 :(得分:1)