Possible Duplicate:
NSNumber retain count issue
Hello, I have the following code:
NSNumber *number = [NSNumber numberWithInt:5];
int i = [number retainCount];
[number release];
i = [number retainCount];
[number release];
i = [number retainCount];
the problem is that in line 2 , the value of parameter i is 2 and in line 4 the value is 1. then in line 6 the value is still 1.????????
first i dont understand why after init *number the retaincount is 2 and not 1?? second i dont understand why after release it 2 times retaincount is not 0? it doesnt matter how many times i release the object the retaincount stay 1.