【问题标题】:How to get the contacts programmatically using MonoTouch c#?如何使用 MonoTouch c# 以编程方式获取联系人?
【发布时间】:2011-03-23 12:10:45
【问题描述】:

如何在 iPhone 中获取联系人?我需要从 iPhone 联系人中获取所有属性。如何使用 MonoTouch 以编程方式实现?

【问题讨论】:

    标签: c# iphone xamarin.ios contacts


    【解决方案1】:
    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
    
        } 
    }
    

    【讨论】:

      【解决方案2】:

      【讨论】:

      • 如何获取联系人的地址?我从接触中得到了所有的价值。但我无法获得地址。
      猜你喜欢
      • 2016-05-28
      • 2013-03-27
      • 2011-04-13
      • 1970-01-01
      • 2012-08-12
      • 1970-01-01
      • 2016-12-26
      • 2023-04-08
      • 2011-06-22
      相关资源
      最近更新 更多