Unwanted retain
Unwanted retain
- Subject: Unwanted retain
- From: Lorenzo <email@hidden>
- Date: Wed, 04 Feb 2004 23:41:23 +0100
Hi,
I noted that when I call scheduledTimerWithTimeInterval, my self object
retainCounter increments by one.
-------
NSLog(@"A self retain count %d", [self retainCount]);
renderTimer = [[NSTimer scheduledTimerWithTimeInterval:timeInterval
target:self selector:@selector(fireTheTimer) userInfo:nil
repeats:YES] retain];
NSLog(@"B self retain count %d", [self retainCount]);
-------
I get:
-------
A self retain count 1
B self retain count 2
-------
Then if I deallocate one time only the object "self" from the class I
created it, I don't see the object self deallocated. I have to deallocate it
twice, but then my app crashes.
Why? Do you know how to fix this?
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.