Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (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];
- }
Add Comment
Please, Sign In to add comment