Created
February 12, 2009 23:29
-
-
Save norio-nomura/62940 to your computer and use it in GitHub Desktop.
wait NSURLConnection's finish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *connectionRunLoopMode = @"connectionRunLoopMode"; | |
NSURLConnection *connection = [[NSURLConnection alloc]initWithRequest:urlRequest delegate:urlConnectionDelegate startImmediately:NO]; | |
NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; | |
[connection unscheduleFromRunLoop:currentRunLoop forMode:NSDefaultRunLoopMode]; | |
[connection scheduleInRunLoop:currentRunLoop forMode:connectionRunLoopMode]; | |
[connection start]; | |
while ([currentRunLoop runMode:connectionRunLoopMode beforeDate:[NSDate distantFuture]]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. Saved my time.