Re: NSThread
Re: NSThread
- Subject: Re: NSThread
- From: Mike Abdullah <email@hidden>
- Date: Tue, 13 Jan 2015 17:57:22 +0000
> On 13 Jan 2015, at 16:18, Mike Abdullah <email@hidden> wrote:
>
>
>> On 13 Jan 2015, at 16:07, Raglan T. Tiger <email@hidden> wrote:
>>
>> I allocate and init an NSThread as follows:
>>
>> if ( m_mythread ) [m_mythread cancel];
>> m_mythread = [[MYThread alloc] initWithTarget:m_mythread selector:@selector(start) object:m_anobject];
>> [m_mythread start];
Looking closer, I have to wonder what you think this code will do. You seem to be trying to create a thread that will message *itself* to do its work. At the time this code is executed, m_mythread will either be nil, or will point to an older thread instance that you’re about to supersede.
I think you need to take a step back and evaluate your app design. What are you actually trying to accomplish here? Would using NSOperationQueue or GCD better suit your needs?
_______________________________________________
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
References: | |
| >NSThread (From: "Raglan T. Tiger" <email@hidden>) |
| >Re: NSThread (From: Mike Abdullah <email@hidden>) |