Sorry for posting this question. I finally found an answer here: https://stackoverflow.com/a/15668026/300986.
The problem was in my init method:
- (id) initWithText:(NSString *)text {
if (!text) return nil;
if ([text length] < 7) return nil;
self = [self init];
if (self) {
// do stuff
}
return self;
}
Those two guard clauses return nil if I don't like the text variable. self is already alloc'ed by that point, so it's Analyzer 1, bmauter 0.
Here's my new version:
- (id) initWithText:(NSString *)text {
self = [self init];
if (!self) return nil;
if (!text || [text length] < 7) {
[self release];
return nil;
}
// do stuff
return self;
}