Re: Trouble with performSelector afterDelay
Re: Trouble with performSelector afterDelay
- Subject: Re: Trouble with performSelector afterDelay
- From: Jens Alfke <email@hidden>
- Date: Mon, 14 Jul 2008 17:49:41 -0700
On 14 Jul '08, at 4:12 PM, Shawn Erickson wrote:
It looks like you override release in your "Worker" object (based on
the back trace you posted). Are you thinking -[Worker release] is the
place to free resources? If so it isn't the right place. You want
-[Worker dealloc].
Right. -release just decrements the refcount; it's the counterpart to -
retain.
I'm uncomfortable with the idea of overriding retain/release/
retainCount. I know that some Apple docs suggest doing so for
singleton objects, but I don't think it's necessary. All you really
need to do is provide a +sharedInstance method like
+ (Worker*) sharedInstance {
static Worker *sInstance;
if( ! sInstance ) sInstance = [[self alloc] init];
return sInstance;
}
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden