• <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 的通讯录中创建联系人?

        时间:2023-10-04

        <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 的通讯录中创建联系人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何从 Xcode4 生成 UML 图 下一篇:如何将 Android ViewPager2 的高度包装到当前项目的高度?

                  相关文章

                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'>

                      • <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>