Skip to content

Instantly share code, notes, and snippets.

@forresty
Created December 19, 2010 14:20
Show Gist options
  • Save forresty/747358 to your computer and use it in GitHub Desktop.
Save forresty/747358 to your computer and use it in GitHub Desktop.
MTStatusBarOverlay Test Case
- (void)viewDidLoad {
[super viewDidLoad];
MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
overlay.animation = MTStatusBarOverlayAnimationShrink;
[overlay showWithMessage:@"Loading..."];
[NSThread detachNewThreadSelector:@selector(loadFromServer) toTarget:self withObject:nil];
}
- (void)loadFromServer {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// perform some remote operations which modifies data used in tableview
[NSThread sleepForTimeInterval:2];
[self performSelectorOnMainThread:@selector(doneLoadFromServer) withObject:nil waitUntilDone:NO];
[pool release];
}
-(void)doneLoadFromServer {
[self.tableView reloadData];
MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
[overlay finishWithMessage:@"Done." duration:2];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment