我正在分析我的应用程序的崩溃报告。看来我对 CFArrayAppendValue 有疑问。
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000000000defe
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 CoreFoundation 0x330f8268 __CFTypeCollectionRetain
1 CoreFoundation 0x330619ca _CFArrayReplaceValues
2 CoreFoundation 0x330618ba CFArrayAppendValue
我试图了解用户如何导致此崩溃,但这对我来说并不明显。使用的代码非常简单:
CFMutableArrayRef CFgroupMemberMutable = CFArrayCreateMutable (NULL,0,&kCFTypeArrayCallBacks);
for (id key in [dataManager getSpecificGroupMembers:groupID]){
ABRecordRef thisContact = ABAddressBookGetPersonWithRecordID (myAddressBook, [key intValue]);
CFArrayAppendValue (CFgroupMemberMutable,thisContact);
}
是因为我尝试附加一个 NULL 值吗?(ABRecordRef 不存在?)是不是回调方法用错了?
感谢您的帮助,约翰·约翰