这是我收到的错误消息:
ContactsWithPN - start loop
Program received signal: “0”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")
这是导致此问题的代码:
+(NSArray *) contactsWithPhoneNumbers{
NSArray *contacts = [ABContactsHelper contacts];
NSMutableArray *rv = [[NSMutableArray alloc] init];
NSLog(@"ContactsWithPN - start loop");
for (int i = 0; i< [contacts count] ; i++) {
ABContact * c = (ABContact*)[contacts objectAtIndex:i];
ABContact * fullContact = [ABContact contactWithRecordID:[c recordID]];
if ([[fullContact phoneArray] count] > 0) {
[rv addObject:fullContact];
}
}
NSLog(@"ContactsWithPN - end loop");
NSArray *ret = [[NSArray alloc] initWithArray:rv];
return ret;
}
在调用上述类方法的视图控制器中,我添加了以下代码以查看是否正在发送内存警告。他们不是!
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
NSLog(@"InviteFriends - memory warning received");
}
观察: + 发现错误发生在不同的时间点 - 有时在索引 253,其他时间在 246 .. + 只发生在 iPhone 上 - 不是模拟器(在模拟器上,有 < 5 个联系人)