• <bdo id='hqcc2'></bdo><ul id='hqcc2'></ul>

  • <small id='hqcc2'></small><noframes id='hqcc2'>

    <legend id='hqcc2'><style id='hqcc2'><dir id='hqcc2'><q id='hqcc2'></q></dir></style></legend>

      1. <tfoot id='hqcc2'></tfoot>

        <i id='hqcc2'><tr id='hqcc2'><dt id='hqcc2'><q id='hqcc2'><span id='hqcc2'><b id='hqcc2'><form id='hqcc2'><ins id='hqcc2'></ins><ul id='hqcc2'></ul><sub id='hqcc2'></sub></form><legend id='hqcc2'></legend><bdo id='hqcc2'><pre id='hqcc2'><center id='hqcc2'></center></pre></bdo></b><th id='hqcc2'></th></span></q></dt></tr></i><div id='hqcc2'><tfoot id='hqcc2'></tfoot><dl id='hqcc2'><fieldset id='hqcc2'></fieldset></dl></div>
      2. 如何在 iPhone SDK 的通讯录中创建联系人?

        How to create contacts in address book in iPhone SDK?(如何在 iPhone SDK 的通讯录中创建联系人?)

        <tfoot id='Iv0pV'></tfoot>
          • <i id='Iv0pV'><tr id='Iv0pV'><dt id='Iv0pV'><q id='Iv0pV'><span id='Iv0pV'><b id='Iv0pV'><form id='Iv0pV'><ins id='Iv0pV'></ins><ul id='Iv0pV'></ul><sub id='Iv0pV'></sub></form><legend id='Iv0pV'></legend><bdo id='Iv0pV'><pre id='Iv0pV'><center id='Iv0pV'></center></pre></bdo></b><th id='Iv0pV'></th></span></q></dt></tr></i><div id='Iv0pV'><tfoot id='Iv0pV'></tfoot><dl id='Iv0pV'><fieldset id='Iv0pV'></fieldset></dl></div>
            <legend id='Iv0pV'><style id='Iv0pV'><dir id='Iv0pV'><q id='Iv0pV'></q></dir></style></legend>

            <small id='Iv0pV'></small><noframes id='Iv0pV'>

              <bdo id='Iv0pV'></bdo><ul id='Iv0pV'></ul>

                    <tbody id='Iv0pV'></tbody>
                  本文介绍了如何在 iPhone SDK 的通讯录中创建联系人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  iPhone SDK中如何在通讯录中创建联系人?

                  How to create contacts in address book in iPhone SDK?

                  推荐答案

                  ABAddressBookRef addressBook = ABAddressBookCreate(); // create address book record
                  ABRecordRef person = ABPersonCreate(); // create a person
                  
                  NSString *phone = @"0123456789"; // the phone number to add
                  
                  //Phone number is a list of phone number, so create a multivalue    
                  ABMutableMultiValueRef phoneNumberMultiValue  = ABMultiValueCreateMutable(kABMultiStringPropertyType);
                  ABMultiValueAddValueAndLabel(phoneNumberMultiValue, phone, kABPersonPhoneMobileLabel, NULL);
                  
                  ABRecordSetValue(person, kABPersonFirstNameProperty, @"FirstName" , nil); // first name of the new person
                  ABRecordSetValue(person, kABPersonLastNameProperty, @"LastName", nil); // his last name
                  ABRecordSetValue(person, kABPersonPhoneProperty, phoneNumberMultiValue, &anError); // set the phone number property
                  ABAddressBookAddRecord(addressBook, person, nil); //add the new person to the record
                  
                  ABRecordRef group = ABGroupCreate(); //create a group
                  ABRecordSetValue(group, kABGroupNameProperty,@"My Group", &error); // set group's name
                  ABGroupAddMember(group, person, &error); // add the person to the group
                  ABAddressBookAddRecord(addressBook, group, &error); // add the group
                  
                  
                  ABAddressBookSave(addressBook, nil); //save the record
                  
                  
                  
                  CFRelease(person); // relase the ABRecordRef  variable
                  

                  这篇关于如何在 iPhone SDK 的通讯录中创建联系人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Why does Objective-C use YES/NO macro convention instead of true/false?(为什么 Objective-C 使用 YES/NO 宏约定而不是 true/false?)
                  Is there any difference between bool, Boolean, and BOOL in Objective-C?(Objective-C 中的 bool、Boolean 和 BOOL 之间有什么区别吗?)
                  BOOL to NSString(布尔到 NSString)
                  Set bool property of all objects in the array(设置数组中所有对象的布尔属性)
                  Is comparing a BOOL against YES#160;dangerous?(将 BOOL 与 YES 进行比较是否危险?)
                  Objective-C dictionary inserting a BOOL(插入 BOOL 的 Objective-C 字典)
                1. <i id='XtYum'><tr id='XtYum'><dt id='XtYum'><q id='XtYum'><span id='XtYum'><b id='XtYum'><form id='XtYum'><ins id='XtYum'></ins><ul id='XtYum'></ul><sub id='XtYum'></sub></form><legend id='XtYum'></legend><bdo id='XtYum'><pre id='XtYum'><center id='XtYum'></center></pre></bdo></b><th id='XtYum'></th></span></q></dt></tr></i><div id='XtYum'><tfoot id='XtYum'></tfoot><dl id='XtYum'><fieldset id='XtYum'></fieldset></dl></div>

                      <small id='XtYum'></small><noframes id='XtYum'>

                        <tbody id='XtYum'></tbody>

                        • <bdo id='XtYum'></bdo><ul id='XtYum'></ul>
                          <tfoot id='XtYum'></tfoot>

                            <legend id='XtYum'><style id='XtYum'><dir id='XtYum'><q id='XtYum'></q></dir></style></legend>