EXC_BAD_ACCESS on [error localizedDescription];
- by david
This Code trows an EXC_BAD_ACCESS:
NSError* error;
if(![appdelegate.managedObjectContext countForFetchRequest:request error:&error]) {
DLog(@"Failed to save to data store: %@", [error localizedDescription]);
NSArray* detailedErrors = [[error userInfo] objectForKey:NSDetailedErrorsKey];
if(detailedErrors != nil && [detailedErrors count] > 0) {
for(NSError* detailedError in detailedErrors) {
DLog(@" DetailedError: %@", [detailedError userInfo]);
}
}
else {
DLog(@" %@", [error userInfo]);
}
}