Skip to content

Instantly share code, notes, and snippets.

@gabriel
Created July 1, 2009 08:50
Show Gist options
  • Save gabriel/138685 to your computer and use it in GitHub Desktop.
Save gabriel/138685 to your computer and use it in GitHub Desktop.
// Invoke after 2 second delay (useful for simulating slow operations)
[[self gh_proxyAfterDelay:2.0] listWithOffset:40 limit:20];
// Invoke on main thread (if you ran on a separate thread or NSOperation
// and wanted to call back the delegate on the main thread)
[self listWithOffset:40 limit:20 delegate:[delegate_ gh_proxyOnMainThread:YES]];
// Later, after listing, the connection invokes the delegate back on the
// main thread
[delegate_ connection:self didListWithOffset:40 limit:20];
// Invoke on thread
[[self gh_proxyOnThread:thread waitUntilDone:NO] listWithOffset:40 limit:20];
// Time the invocation
NSTimeInterval time;
[[self gh_timedProxy:&time] listWithOffset:40 limit:20];
NSLog(@"Took %0.2fs", time);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment