2
에 대한 CFDictionaryRef 접근에 문제가 같은 ObjC에서 연락처의 주소 정보,스위프트 : I'v ABAddressBookRef
가ABMultiValueRef addressProperty = ABRecordCopyValue(contactRef, kABPersonAddressProperty);
CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(addressProperty, 0);
if(dict)
{
NSString *street = (NSString *)CFDictionaryGetValue(dict, kABPersonAddressStreetKey);
}
그래서, 해당 스위프트 코드는 것,
let addressProperty : ABMultiValueRef = ABRecordCopyValue(contactRef, kABPersonAddressProperty).takeUnretainedValue() as ABMultiValueRef
if let dict : CFDictionaryRef = ABMultiValueCopyValueAtIndex(addressProperty, 0).takeUnretainedValue() as? CFDictionaryRef
{
let street = CFDictionaryGetValue(dict,kABPersonAddressStreetKey)
// Stuck here, among CFString!, UnsafePointer<Void>, CFDictionaryRef ...
}
를 수집하는 방법은 거리를 가져옵니다 및 다른 유사한 정보?
아, 그래, 내가 dict .__ conversion()을 사용하여 해결 했으므로 CFDictionaryRef를 NSDictionary로 변환하지만 지금은 NSDictionary로 바로갑니다. 감사 – BaSha