Re: Garbage Collection, Standard Out, NSTask
Re: Garbage Collection, Standard Out, NSTask
- Subject: Re: Garbage Collection, Standard Out, NSTask
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 16 Nov 2010 09:53:52 -0800
The issue [I'd bet -- don't have time to dive deep] is that you don't have a strong reference to the Tasker instance.
Since notification observers don't hold strong references to observers, either, the garbage collector sees Tasker as garbage and collects it.
You could fix this any number of ways;
- keep a reference to the Tasker instance as an iVar
- keep a global set around of "active taskers" and have 'em remove themselves when they are done
- use CFRetain or the NSGarbageCollector API to tell the collector not to collect the tasker before done.
b.bum
_______________________________________________
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