myell0w / MTStatusBarOverlay

A custom iOS status bar overlay seen in Apps like Reeder, Evernote and Google Mobile App
MIT License
1.92k stars 325 forks source link

Repeating done over and over on iPad. #66

Open ghost opened 11 years ago

ghost commented 11 years ago

New to this whole game, but here we go. I have 3 storyboards, 3.5, 4" and iPad. Works flawlessly in simulator (as it always has), but recently I added that iPad storyboard, for more a universal app. One tester reported that it repeats "done" over and over.

I tried returning to default, no luck. Keep in mind I took over our app project for our forum. This is how the previous author implemented it into our app.

// MainViewController.h // // Created by Chris on 3/20/2013. // Copyright (c) 2013 Chris. All rights reserved. //

import "PullToRefreshView.h"

import <QuartzCore/QuartzCore.h>

import "MTStatusBarOverlay.h"

@interface MainViewController : UIViewController <PullToRefreshViewDelegate, UIWebViewDelegate, UIGestureRecognizerDelegate, MTStatusBarOverlayDelegate, UIScrollViewDelegate> {

IBOutlet UIWebView *webView;    
IBOutlet UIScrollView *currentScrollView;
NSTimer *timer;
UIApplication *app;
double myNumber;
MTStatusBarOverlay *overlay;
IBOutlet UIImageView *splash35Inch;
IBOutlet UIImageView *splash4Inch;
IBOutlet UIImageView *splashPad;
IBOutlet UIImageView *splashPadLandscape;

}

@property (nonatomic, retain) UIImageView splash35Inch; @property (nonatomic, retain) UIImageView splash4Inch; @property (nonatomic, retain) UIImageView splashPad; @property (nonatomic, retain) UIImageView splashPadLandscape;

@end

///////////////////////////////////////////////

// MainViewController.m // // Created by Chris on 3/20/2013. // Copyright (c) 2013 Chris. All rights reserved. //

import "MainViewController.h"

//Random app code//

-(void)pullToRefreshViewShouldRefresh:(PullToRefreshView )view { [(UIWebView )[self.view viewWithTag:999] reload]; [overlay postMessage:@"Reloading" duration:1 animated:YES]; }

If anybody has any ideas why it keeps calling done, I'd appreciate it.

UPDATE: How our forum is set up, we have ads running, unless your an advanced member. So the status bar overlay is registering that web load, over and over again. Seeing how its not a direct code issue we can mark this as solved.

However, if somebody has an idea on how to get it to distinguish between a forum web page and ads, that would be helpful.

ghost commented 11 years ago

I added a bit in - (void)webViewDidFinishLoad:(UIWebView *)webview which stalls the webView load until everything is done loading. So with this implemented, no more rapid fire "Done" messages. Heres what I used.


if (webview.isLoading)
    return;

NSLog(@"Done!" );
[(PullToRefreshView *)[self.view viewWithTag:998] finishedLoading];
[overlay postFinishMessage:@"Done!" duration:1 animated:YES];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;

}

///// UPDATE: This method above does not work on 5.0 targeted devices. Any ideas?