ABPersonAddressKey 类

定义

NSDictionary 用于地址的 ABPerson 密钥。

[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.None, "Use the 'Contacts' API instead.")]
public static class ABPersonAddressKey
type ABPersonAddressKey = class
继承
ABPersonAddressKey
属性

注解

单个 NSDictionary 实例存储单个地址,字典键和值保存地址的不同部分:

// Address from: https://en.wikipedia.org/wiki/Address_(geography)#United_States
NSDictionary address = NSDictionary.FromObjectsAndKeys(
    new NSObject[]{
        new NSString("455 Larkspur Dr."),
        new NSString("California Springs"),
        new NSString("CA"),
        new NSString("92926"),
        new NSString("USA"),
        new NSString("us"),
    },
    new NSObject[]{
        ABPersonAddressKey.Street,
        ABPersonAddressKey.City,
        ABPersonAddressKey.State,
        ABPersonAddressKey.Zip,
        ABPersonAddressKey.Country,
        ABPersonAddressKey.CountryCode,
    }
);
ABMutableDictionaryMultiValue addresses = new ABMutableDictionaryMultiValue() {
  { address, ABLabel.Home },
};
ABPerson person = GetMeSomePerson();
person.SetAddresses(addresses);

属性

City

表示与常量 kABPersonAddressCityKey 关联的值

Country

表示与常量 kABPersonAddressCountryKey 关联的值

CountryCode

表示与常量 kABPersonAddressCountryCodeKey 关联的值

State

表示与常量 kABPersonAddressStateKey 关联的值

Street

表示与常量 kABPersonAddressStreetKey 关联的值

Zip

表示与常量 kABPersonAddressZIPKey 关联的值

适用于

另请参阅