Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. [MBProgressHUD showHUDAddedTo:self.view animated:YES];
  2.  
  3. [MBProgressHUD hideHUDForView:self.view animated:YES];
  4.  
  5. [MBProgressHUD showHUDAddedTo:self.view animated:YES];
  6.  
  7. dispatch_queue_t myqueue = dispatch_queue_create("queue", NULL);
  8. dispatch_async(myqueue, ^{
  9.  
  10. [self performSelectorOnMainThread:@selector(fetchedData:) withObject:nil waitUntilDone:YES];
  11.  
  12. dispatch_async(dispatch_get_main_queue(), ^{
  13. [self.tbl reloadData];
  14. [MBProgressHUD hideHUDForView:self.view animated:YES];
  15. });
  16. });
  17.  
  18. [MBProgressHUD showHUDAddedTo:self.view animated:YES];
  19.  
  20. dispatch_queue_t myqueue = dispatch_queue_create("queue", NULL);
  21. dispatch_async(myqueue, ^{
  22.  
  23. //Whatever is happening in the fetchedData method will now happen in the background
  24. [self fetchedData:nil];
  25.  
  26. dispatch_async(dispatch_get_main_queue(), ^{
  27. [self.tbl reloadData];
  28. [MBProgressHUD hideHUDForView:self.view animated:YES];
  29. });
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement