Guest User

Untitled

a guest
Jul 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. - (void)viewDidLoad {
  2. [super viewDidLoad];
  3.  
  4. MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
  5. overlay.animation = MTStatusBarOverlayAnimationShrink;
  6. [overlay showWithMessage:@"Loading..."];
  7.  
  8. [NSThread detachNewThreadSelector:@selector(loadFromServer) toTarget:self withObject:nil];
  9. }
  10.  
  11. - (void)loadFromServer {
  12. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  13. // perform some remote operations which modifies data used in tableview
  14. [NSThread sleepForTimeInterval:2];
  15. [self performSelectorOnMainThread:@selector(doneLoadFromServer) withObject:nil waitUntilDone:NO];
  16.  
  17. [pool release];
  18. }
  19.  
  20. -(void)doneLoadFromServer {
  21. [self.tableView reloadData];
  22. MTStatusBarOverlay *overlay = [MTStatusBarOverlay sharedInstance];
  23. [overlay finishWithMessage:@"Done." duration:2];
  24. }
Add Comment
Please, Sign In to add comment