SORU
12 EYLÜL 2014, Cuma


ABPeoplePickerNavigationController değişiklikler iOS8 ile?

Güncelleştirilmiş böyle büyük mükafat (6.0, 6A313) ve benim iOS (8.0, 12A365) gm tohumlar için iPhone aldığım için, ABPeoplePickerNavigationController kodu eskisi gibi çalışmıyor.

  • iOS 7.1.2: Eğer birini almak istiyorum bir kişi, adres defteri açılır ve gördüğünüz tam listesi kişileri, sonra toplama, açılır ayrıntı görünümü bir iletişim ve daha ekleyebilirsiniz kişiyi bir tıklama ile telefon numarası almak istiyorum.

  • iOS 8.0: onun her şeye benzer ama bir irtibat numarası tıklarsanız o telefon numarasını çevirmek yerine.. . ithal

Kod:

#pragma mark - AddressBook Delegate Methods

-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person{
    return YES;
}


-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier{

    // Get the first and the last name. Actually, copy their values using the person object and the appropriate
    // properties into two string variables equivalently.
    // Watch out the ABRecordCopyValue method below. Also, notice that we cast to NSString *.
    NSString *firstName = (__bridge NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);
    NSString *lastName = (__bridge NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);

    // Compose the full name.
    NSString *fullName = @"";
    // Before adding the first and the last name in the fullName string make sure that these values are filled in.
    if (firstName != nil) {
        fullName = [fullName stringByAppendingString:firstName];
    }
    if (lastName != nil) {
        fullName = [fullName stringByAppendingString:@" "];
        fullName = [fullName stringByAppendingString:lastName];
    }


    // Get the multivalue number property.
    CFTypeRef multivalue = ABRecordCopyValue(person, property);

    // Get the index of the selected number. Remember that the number multi-value property is being returned as an array.
    CFIndex index = ABMultiValueGetIndexForIdentifier(multivalue, identifier);

    // Copy the number value into a string.
    NSString *number = (__bridge NSString *)ABMultiValueCopyValueAtIndex(multivalue, index);

    nameTextField.text = fullName;
    numberTextField.text = number;

    // Dismiss the contacts view controller.
    [_addressBookController dismissViewControllerAnimated:YES completion:nil];

    return NO;
}


// Implement this delegate method to make the Cancel button of the Address Book working.
-(void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker{
    [_addressBookController dismissViewControllerAnimated:YES completion:nil];
}

herhangi bir cevap bulamadım iOS apple geliştirici kütüphane. başka biri için bir çözüm var mı?

CEVAP
12 EYLÜL 2014, Cuma


iOS 8 yeni temsilci bir yöntemi bunun için uygulanması gerekir:

- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
}

Yerde eski temsilci yöntemi iOS 7 veya daha önceki destek için tutun. Benim app ben ne iOS 8 temsilci yöntemi iOS 7 temsilci yöntemi

- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
    [self peoplePickerNavigationController:peoplePicker shouldContinueAfterSelectingPerson:person property:property identifier:identifier];
}

Eğer bu temsilci yöntem iOS uygulanmadı ise 8, dokunarak değer eylem neden olur. Ne zaman uygulamaya temsilci yerine seçilen değeri olarak adlandırılır.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Breno Rises

    Breno Rises

    7 Ocak 2014
  • Blu animations and other videos

    Blu animatio

    15 HAZİRAN 2007
  • OnlyFunClips

    OnlyFunClips

    16 ŞUBAT 2012