gpt4 book ai didi

iphone - Objective-C iPhone地址簿: kABPersonAddressStreetKey

转载 作者:行者123 更新时间:2023-12-03 20:26:07 25 4
gpt4 key购买 nike

我正在获取地址簿 kABPersonAddressStreetKey 属性。当有多条街道时,值将连接成一个字符串。

[addressDict setObject:self.address.street1 forKey:(NSString *)kABPersonAddressStreetKey];

有时我想用新的街道名称更改此属性...当有多条街道时该怎么做?

问题示例:

= Address1
=== StreetName1
=== StreetName2
=> 2 streets names

get the line : "StreetName1 StreetName2"
changes in streets names...
save the line will change the address to

= Address1
=== StreetName3 StreetName4
=> 1 street name

but i want

= Address1
=== StreetName3
=== StreetName4
=> 2 streets names

我希望我说得足够清楚......

最佳答案

使用\n分隔地址。因此,例如:

NSString *addresses = [NSString stringWithFormat:@"%@\n%@", self.address.street1, self.address.street2];
[addressDict setObject:addresses forKey:(NSString *)kABPersonAddressStreetKey];

关于iphone - Objective-C iPhone地址簿: kABPersonAddressStreetKey,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5152474/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com