Advertisement
Guest User

NSOperation runloop

a guest
Sep 22nd, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. -(void) main
  2. {
  3. NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
  4.  
  5. // initialize request
  6.  
  7. NSURLConnection* theConnection = [ NSURLConnection connectionWithRequest: request delegate: self];
  8. [theConnection start];
  9.  
  10. while(!finished) {
  11. [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
  12. }
  13.  
  14. if(self.success) {
  15. // process the data
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement