Re: Problem cancelling lengthy task in secondary thread
Re: Problem cancelling lengthy task in secondary thread
- Subject: Re: Problem cancelling lengthy task in secondary thread
- From: Ben Dougall <email@hidden>
- Date: Thu, 30 Oct 2003 14:43:27 +0000
On Thursday, October 30, 2003, at 01:53 pm, Jvrn Salewski wrote:
am 30.10.2003 13:31 Uhr schrieb Alastair J.Houghton unter
email@hidden:
On Thursday, October 30, 2003, at 11:53 am, Jvrn Salewski wrote:
Has anybody got an idea of what's going wrong?
//if (! _continue) goto CANCEL;
if (![_controller searchInProgress]) {
goto CANCEL;
}
I wonder whether CANCEL is #defined as a macro... try changing your
code to use lower-case and see if that fixes it.
It's no macro. Only a simple goto label/ marker to jump to.
(One thing that makes
me suspicious that this might be the problem is the fact that the code
you claim works has braces, whereas the code you claim doesn't,
doesn't.)
I tried out braces in despair, but it didn't change anything.
I was also NSLoging the _continue variable, but it's not changed until
the
inner loops are done; it's apparently not a problem of checking for its
value, but setting it.
I would assume that my setter method would return immediately even if
declared simply as void instead of oneway void, since it's just about
changing a variable and not any lengthy task. However, if doing so the
button triggering this method will be highlighted until the inner
search
loops are finished.
I suspect that I'm overlooking something with the DO/ multithreading
stuff,
or that it has something to do with the runloop, but actually I have no
clue.
Btw _continue and [_controller searchInProgress] are not refering the
same
variable.
Any other suggestions?
according to o'relly's objective-c pocket reference: "your classes
should not have methods or fields [that's the book's way of saying
instance variables] that start with an underscore" - could be that? i
don't know.
which come to think of it is contradictory to something i read
somewhere else (was it 'cocoa programming'?) that suggests using
underscored variables as a way of labelling them "for private/internal
use".
_______________________________________________
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.