mik*_*big 6 exception ios9 xcode7 cncontact
我在使用unifiedContactWithIdentifier:keysToFetch:error:并使用CNContactImageDataKey在目标C中重新获取CNContact后尝试获取imageData.
在运行期间,我总是有相同的异常CNPropertyNotFetchedException甚至重新联系并检查imageData调用imageDataAvailable.这没有意义.swift中的相同代码很棒.
那么,目标C的Contact框架中是否存在问题?
我在iOS 6和iPhone 9.0.2上使用XCode 7.0构建.
这里的代码:
// ...
// ...
if([currentNativeContact isKeyAvailable:CNContactImageDataKey] &&
currentNativeContact.imageDataAvailable) {
previewImage = [UIImage imageWithData:currentNativeContact.thumbnailImageData];
}
else {
NSError *error;
currentNativeContact = [self.contactsStore unifiedContactWithIdentifier:currentNativeContact.identifier keysToFetch:@[CNContactImageDataKey] error:&error];
if(!error && currentNativeContact.imageDataAvailable)
previewImage = [UIImage imageWithData:currentNativeContact.thumbnailImageData];
}
Run Code Online (Sandbox Code Playgroud)
谁能帮我 ?谢谢,米歇尔
| 归档时间: |
|
| 查看次数: |
2618 次 |
| 最近记录: |