about NSThread crash
about NSThread crash
- Subject: about NSThread crash
- From: Chris(吴潮江) <email@hidden>
- Date: Wed, 24 Jun 2009 14:12:16 +0800
- Importance: Normal
Hi,
I have some problems when to using thread. As we all know, there is a method to create a thread,
+ (void)detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget withObject:(id)anArgument.
- (void)aSelector:(id)anArgument
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Here I implement FTP functions. e.g. download/ pause download/ resume download file.
[pool release];
[NSThread exit];
}
To my surprise, when downloading a file, I pause download and no error display. Then I resume to download file,
it's ok. However, at this time I pause download file, there will be a error showing EXC_BAD_ACCESS and the stack
information is:
mach_msg_trap
mach_msg
CFRunLoopRunSpecific
CFRunLoopRunInMode
RunCurrentEventLoopInMode
ReceiveNextEventCommon
BlockUnitlNextEventMatchingListInMode
_DPSNextEvent
_[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
_[NSApplication run]
NSApplicationMain
I don't know why?
Please tell me the reason if anyone knows.
Thanks.
_______________________________________________
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