My crashlog is here.
This crash occurs on some of the testers. One tester with iPhone 6 (iOS 8.4.1) crashes but another tester with the same device (also iOS 8.4.1) doesn't crash. It also works on simulator.
I know this has been asked before but I think the problem is about ABPeoplePickerNavigationController
. Or maybe this is a problem about Crashlytics.
What I wonder is: why do the same devices with the same operating system works differently? Also, I appreciate any solution to this problem?
Here is my code:
func peoplePickerNavigationController(peoplePicker: ABPeoplePickerNavigationController!, didSelectPerson person: ABRecord!, property: ABPropertyID, identifier: ABMultiValueIdentifier) {
if property != kABPersonPhoneProperty {
return
}
let phoneNumbers: ABMultiValueRef = ABRecordCopyValue(person, kABPersonPhoneProperty).takeRetainedValue()
if (ABMultiValueGetCount(phoneNumbers) > 0) {
let index = ABMultiValueGetIndexForIdentifier(phoneNumbers, identifier)
let selectedPhoneNumber = ABMultiValueCopyValueAtIndex(phoneNumbers, index).takeRetainedValue() as! String
let newNumber = "tel:\(phoneNumber)"
println(newNumber)
let url = NSURL(string: newNumber)
if UIApplication.sharedApplication().canOpenURL(url!) {
//test
//UIApplication.sharedApplication().openURL(url!)
} else {
return
}
} else {
return
}
}