Skip to content

Instantly share code, notes, and snippets.

@ddribin
Created September 13, 2009 18:58
Show Gist options
  • Save ddribin/186285 to your computer and use it in GitHub Desktop.
Save ddribin/186285 to your computer and use it in GitHub Desktop.
- (void)start;
{
if (![NSThread isMainThread])
{
[self performSelectorOnMainThread:@selector(start) withObject:nil waitUntilDone:NO];
return;
}
NSLog(@"opeartion for <%@> started.", _url);
[self willChangeValueForKey:@"isExecuting"];
_isExecuting = YES;
[self didChangeValueForKey:@"isExecuting"];
NSURLRequest * request = [NSURLRequest requestWithURL:_url];
_connection = [[NSURLConnection alloc] initWithRequest:request
delegate:self];
if (_connection == nil)
[self finish];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment