开发者

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

开发者 https://www.devze.com 2023-01-22 04:22 出处:网络
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.

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

精彩评论

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