initWithDomain:code:userInfo:
is the designated initializer for NSError. That means don't call plain init
.
You would get the same crash just by saying this:
NSLog(@"%@", [[NSError alloc] init]);
The problem has nothing to do with automatic ref counting, autorelease, autorelease pool, strong, or any of that other stuff! It's just that you are making a bad NSError object and then trying to log it.