默认iPhone地址簿人物电话号码标签周围有哪些标签? [英] What are the Tags Around Default iPhone Address Book People Phone Number Labels?

查看:199
本文介绍了默认iPhone地址簿人物电话号码标签周围有哪些标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题涉及围绕iPhone上联系人列表的人员条目中的某些默认电话号码标签的标记。

My question concerns markup that surrounds some of the default phone number labels in the Person entries of the Contact list on the iPhone.

我为一个人John Smith创建了一个iPhone联系人列表地址簿条目,其中包含以下电话号码:

I have created an iPhone contact list address book entry for a person, "John Smith" with the following phone number entries:


  • 手机(604)123-4567

  • iPhone(778)123-4567

  • 主页( 604)789-4561

  • 工作(604)456-7891

  • Main(604)789-1234

  • megaphone(234)567-8990

  • Mobile (604) 123-4567
  • iPhone (778) 123-4567
  • Home (604) 789-4561
  • Work (604) 456-7891
  • Main (604) 789-1234
  • megaphone (234) 567-8990

请注意,前五个标签是Contacts应用程序和最后一个标签提供的默认标签,扩音器,是一个自定义标签。

Note that the first five labels are default labels provided by the Contacts application and the last label, "megaphone", is a custom label.

我写了以下方法来检索和显示地址簿中每个人的标签和电话号码:

I wrote the following method to retrieve and display the labels and phone numbers for each person in the address book:

-(void)displayPhoneNumbersForAddressBook {
    ABAddressBookRef book = ABAddressBookCreate();
    CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(book);
    ABRecordRef record = CFArrayGetValueAtIndex(people, 0);
    ABMultiValueRef multi = ABRecordCopyValue(record, kABPersonPhoneProperty); 
    NSLog(@"---------" );
    NSLog(@"displayPhoneNumbersForAddressBook" );

    CFStringRef label, phone;
    for (CFIndex i = 0; i < ABMultiValueGetCount(multi); ++i) {
            label = ABMultiValueCopyLabelAtIndex(multi, i);
            phone = ABMultiValueCopyValueAtIndex(multi, i);
            NSLog(@"label: \"%@\"     number: \"%@\"", (NSString*)label, (NSString*)phone);
            CFRelease(label);
            CFRelease(phone);
    }
    NSLog(@"---------" ); 
    CFRelease(multi);
    CFRelease(people);
    CFRelease(book);
}

这是我输入的地址簿条目的输出:

and here is the output for the address book entry that I entered:

2010-03-08 13:24:28.789 test2m[2479:207] ---------
2010-03-08 13:24:28.789 test2m[2479:207] displayPhoneNumbersForAddressBook
2010-03-08 13:24:28.790 test2m[2479:207] label: "_$!<Mobile>!$_"     number: "(604) 123-4567"
2010-03-08 13:24:28.790 test2m[2479:207] label: "iPhone"     number: "(778) 123-4567"
2010-03-08 13:24:28.791 test2m[2479:207] label: "_$!<Home>!$_"     number: "(604) 789-4561"
2010-03-08 13:24:28.791 test2m[2479:207] label: "_$!<Work>!$_"     number: "(604) 456-7891"
2010-03-08 13:24:28.792 test2m[2479:207] label: "_$!<Main>!$_"     number: "(604) 789-1234"
2010-03-08 13:24:28.792 test2m[2479:207] label: "megaphone"     number: "(234) 567-8990"
2010-03-08 13:24:28.793 test2m[2479:207] ---------

什么是标记字符

_$!< and >!$_

除了iPhone之外,还有默认标签?

surrounding most, save for iPhone, of the default labels for?

你能指点我在iPhone OS地址簿编程指南中找到的信息吗?

Can you point me to where in the "Address Book Programming Guide for iPhone OS" I can find the information?

感谢您的帮助。

推荐答案

我正在跑步进入同一个问题。这是我到目前为止的想法。

I'm running into the same issue. This is what I think so far.

您的看见标记向系统显示这是默认标签而非自定义标签的标记。如果您运行此代码:

NSLog(kABOtherLabel);

The markup that your seeing indicates to the system that this is a Default label and not a custom label. If you run this code:
NSLog(kABOtherLabel);

你将ge结果:

_ $!< Other>!$ _

这样是存储在 kABOtherLabel 常量(类型为CFStringRef)中的值。我认为 iPhone 的原因是它没有标记,因为它是一个'自定义'标签,但它是由Apple而不是用户发起的。

So that is the value stored in the kABOtherLabel constant (of type CFStringRef). I think the reason iPhone doesn't have the markup around it is becuase it's a 'Custom' label, but it's one originated by Apple instead of the user.

您可以为标签提供您喜欢的任何价值,如上面的扩音器标签所示。但请注意,如果您尝试创建带有其他标签的电话号码(或电子邮件地址)而不使用 kABOtherLabel 常量或其值 _ $!< Other>!$ _ ,系统会认为您正在创建自定义标签。就像在这个例子中一样:

You can give the label any value you like, as evidenced by your megaphone label above. But notice that if you try and create a phone number (or e-mail address) with the label 'other' without using the kABOtherLabel constant or it's value _$!<Other>!$_, the system will think that you're creating a custom label. Like in this example:

ABMultiValueAddValueAndLabel(email, @"nospam@notarealdomain.com", @"other", NULL);

如果您在iPhone上编辑该地址簿条目,它将显示在单独的自定义标签列表中。 (所以'other'将有2个选项,一个在默认值中,一个在自定义标签中)

And if you go and edit that Address Book entry on the iPhone, it will show up in a separate list of custom labels. (So there will be 2 choices for 'other', one in the defaults and one in the custom labels)

虽然这没有回答你的问题,但我希望它帮助。

While this hasn't answered your question, I hope it helps.

这篇关于默认iPhone地址簿人物电话号码标签周围有哪些标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆