thread communication ... with a little problem
thread communication ... with a little problem
- Subject: thread communication ... with a little problem
- From: Yorh <email@hidden>
- Date: Tue, 18 Apr 2006 10:39:42 +0200
Hi to all,
I have a little problem with a worker thread in my app.
I have a NSWindowController class, inside it (when the window is
started) a new thread starts in a for (; ; ) infinite loop.
I need to stop the thread when the window is closed.
I added a new method:
-(BOOL)windowShouldClose
{
// I should exit the thread here
}
but if I type [NSThread exit] the app of course crashes because
NSThread is the main thread and not the new worker one.
I need something to close the worker thread started in another method :
-(void)loopThread
{
NSAutoreleasePool * thePool = [[NSAutoreleasePool alloc]init];
for (; ;){
}
[thePool release];
}
I tried to use an accessor method to return NSThread object but it
doesn't work and the notification system isn't the right way to do it
(I think).
Any idea?
Thank you all for your always kind support
Yorh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden