I have a very simple Person class that has ivar named name (NSString). When I try to release this ivar in dealloc, the static analyzer gives me a strange error:
Incorrect link decrement counting an object that is not currently owned by the caller
What am I doing wrong?
By the way, here is my code:
@interface Person : NSObject { } @property (copy) NSString *name; @property float expectedRaise; @end @implementation Person @synthesize name, expectedRaise; -(id) init { if ([super init]) { [self setName:@"Joe Doe"]; [self setExpectedRaise:5.0]; return self; }else { return nil; } } -(void) dealloc{ [[self name] release];
source share