开发者

How to ignore iphone tab bar presses until tab has finished loading?

I have 2 tabs in my application, when a tab is pressed an RSS feed is loaded and MBProgressHUB shows a loading spinner until the tab has finished loading and the view has appeared.

However if the other tab is pressed whilst the tab is still loading, 2 开发者_StackOverflowMBProgressHUB spinners appear and then the app crashes.

Is there anyway to ignore tab bar presses until the tab has finished loading?

My Code:

    -(void)refreshdata { 
 mbProcess=[[MBProgressHUD alloc] initWithView:self.view];
 mbProcess.labelText=@"Downloading data...";
 [theTable addSubview:mbProcess];
 [mbProcess setDelegate:self];
 [mbProcess show:YES];


 ......


    - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
 ......

 [mbProcess hide:YES];

Many Thanks!


Check if mbProcess is not nil and visible at beginning of refereshData, if so just return;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜