I'm trying to figure out how NSRunLoop works. So there are a few delayed tasks and I want to perform them in a few seconds using NSRunLoop. And I want to create NSRunLoop manually. How am I supposed to do this?
NSRunLoop *loop = [NSRunLoop currentRunLoop];
//create delayed tasks
[object performSelector:NSSelectorFromString(@"firstMethod") withObject:firstArgument afterDelay:5.0];
[object performSelector:NSSelectorFromString(@"secondMethod") withObject:secondArgument afterDelay:3.0];
//and here I must run a loop
while(flag&&[loop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);
And also I have somehow to stop this loop. As you see I'm totally confused and lots of Apple's documentation and topics here didn't help me.