Created
December 19, 2010 14:20
-
-
Save forresty/747358 to your computer and use it in GitHub Desktop.
MTStatusBarOverlay Test Case
This file contains 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
- (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