Firstly, your loop is incorrect. +stringWithCString:…is not +alloc/ +new…/ -copyso you do not have -releaseit.
Is one of them true:
Not -release:
str = [NSString stringWithCString: "Name" encoding: NSUTF8StringEncoding];
person.name = str;
Use -init:
str = [[NSString alloc] initWithCString: "Name" encoding: NSUTF8StringEncoding];
person.name = str;
[str release]
, -[Person init]:
- (id) init {
if ((self = [super init])) {
name = [DEFAULT_NAME copy];
}
return self;
}
, №1, , , №2 , .
,
str = [NSString stringWithCString: "Name" encoding: NSUTF8StringEncoding];
str = [[[NSString alloc] initWithCString:......] autorelease];
an -autorelease d " NSAutoreleasePool ".
? , . *, . 10 9 .
№ 2 , . ( , - .)
:
*: A run loop - , . CLI, .