ios - GCD and progressHUDs -


using form of progresshud (sv, mb, etc) run problem hud either hidden right after displayed or stays there permanently. in below example, hud stays permanently, regardless of if twitter feed (or page other view controllers) has finished loading. how can make hud disappear after task in separate thread completes?

[mbprogresshud showhudaddedto:self.view animated:yes]; dispatch_async(dispatch_get_global_queue( dispatch_queue_priority_low, 0), ^{         //sets auth key (user or app) rmacc twitter feed        sttwitterapi *twitter = [sttwitterapi twitterapioswithfirstaccount];         [twitter verifycredentialswithsuccessblock:^(nsstring *username) {             [twitter getusertimelinewithscreenname:@"rmaccnewsnotes" count:10 successblock:^(nsarray *statuses) {                 dispatch_async(dispatch_get_main_queue(), ^{                    [mbprogresshud hidehudforview:self.view animated:yes];                });                 self.twitterfeed =[nsmutablearray arraywitharray:statuses];                 [self.tableview reloaddata];              } errorblock:^(nserror *error){ }];          } errorblock:^(nserror *error) {             [self twitterselfauthrequest];         }];      });         } 

it should this:

[mbprogresshud showhudaddedto:self.view animated:yes]; dispatch_async(dispatch_get_global_queue( dispatch_queue_priority_low, 0), ^{  // twitter stuff, including error checking        dispatch_async(dispatch_get_main_queue(), ^{          [self.tableview reloaddata];          [mbprogresshud hidehudforview:self.view animated:yes];       }); }); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -