Re: Question about NSThread?
Re: Question about NSThread?
- Subject: Re: Question about NSThread?
- From: Jean-Nicolas Jolivet <email@hidden>
- Date: Wed, 19 Nov 2008 17:44:05 -0500
Thanks for all the reply!
By digging a little deeper I can see that everything isn't working
quite as smoothly as I thought it was...! All the info is quite
welcomed!
Jean-Nicolas Jolivet
On 19-Nov-08, at 3:57 PM, Jean-Nicolas Jolivet wrote:
I have an app that generates a bunch of images... the process can be
long so I wanted to start it in a separate thread so that the UI can
be responsive etc...
basically the only thing I did was:
[NSThread detachNewThreadSelector:@selector(doLongProcess)
toTarget:self withObject:nil];
and I added
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
at the beginning of my doLongProcess method, and [pool release] at
the end...
Now the weird part is that... it appears to be working... the images
are created...the UI stays responsive..my status textfield gets
updated (it wasn't getting updated when the long process was not in
a separate thread)...
Am I wrong to think that it should've been much more complex than
that? (With NSLocks and whatnot...) Maybe I should just shut up and
be happy that it work, but somehow this doesn't seem right...
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_______________________________________________
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
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_______________________________________________
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