Created
August 9, 2010 04:46
-
-
Save Kentzo/514947 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| { | |
| NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
| /* | |
| ... | |
| */ | |
| //use a custom runloop | |
| static NSString *runLoopMode = @"com.me.myloop"; | |
| [connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:runLoopMode]; | |
| [connection start]; | |
| while (![connectionDelegate isDone] && ![self isCancelled]) { | |
| [[NSRunLoop currentRunLoop] runMode:runLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.3f]]; | |
| } | |
| if ([self isCancelled]) {} | |
| else {} | |
| [pool release]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment