Re: Compiler skipping code
Re: Compiler skipping code
- Subject: Re: Compiler skipping code
- From: Sherm Pendley <email@hidden>
- Date: Wed, 20 Feb 2002 10:16:03 -0500
On Tuesday, February 19, 2002, at 09:08 PM, Daniel Byer wrote:
When debugging my application, the compiler completely skips over this
line of code, not even executing it:
[[[NSThread alloc] init]
detachNewThreadSelector:@selector(threadCommunicate:) toTarget:self
withObject:nil];
It's not executing it because it's incorrect. The method you're calling
isn't an instance method - it's static. You should call it like this
instead:
[NSThread detachNewThreadSelector: @selector(threadCommunicate)
toTarget: self withObject: nil];
Didn't PB complain about this when you built your project? It should
have issued a "NSThread does not respond to ..." warning. It definitely
should not have skipped over it silently.
sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.