performSelector:withObject:afterDelay: question
performSelector:withObject:afterDelay: question
- Subject: performSelector:withObject:afterDelay: question
- From: Mike Laster <email@hidden>
- Date: Fri, 09 Aug 2002 11:35:17 -0400
Are sequential performSelector:withObject:afterDelay: scheduled performs
guaranteed to be performed in the same order? The documentation doesn't say
one way or the other.
If I do:
[self performSelector:@selector(handleString:) withObject:@"One"
afterDelay:0.0];
[self performSelector:@selector(handleString:) withObject:@"Two"
afterDelay:0.0];[self performSelector:@selector(handleString:)
withObject:@"Three" afterDelay:0.0];
While inside of a run loop callout, will NSRunLoop guarantee that
handleString: is called with @"One", @"Two" and @"Three" in that order?
I'm trying to do this because the current callout is a socket 'receive data'
Callout, and the target selector (handleString:) sometimes needs to run a
sub runloop. Nested NSRunLoops don't appear to work properly for
sockets...I can nest it, but I will never receive any more socket data until
the current callout completes. I figured if I could schedule the data
handling to "slightly in the future" with delayed-perform then I could free
up the socket resource to allow it to accept data again.
_______________________________________________
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.