EDIT: I SOLVED IT
I solved it.
I changed:
@property(nonatomic,retain) UIActivityIndicatorView *activityIndicator;
to
@property(nonatomic,retain) IBOutlet UIActivityIndicatorView *activityIndicator;
MY QUESTION:
I am making a simple UIWebView app and I want the indicator to stop spinning when it is done loading the webpage. I checked “hide when done” in the storyboarding interface and I have connected the indicator to the view controller (activityIndicator). It still doesn’t stop. In my header file, I have this:
@interface ViewController : UIViewController<UIWebViewDelegate>{
IBOutlet UIBarButtonItem *bBack, *bForward, *toolbarStop, *toolbarRefresh;
IBOutlet UIActivityIndicatorView *_activityIndicator;
BOOL internetOK;
NSTimer *timer;
}
-(void)tryInternet;
-(void)loading;
-(void)startAnimating;
-(void)stopAnimating;
-(void)verifyInternet;
-(IBAction)refresh:(id)sender;
-(IBAction)dontTouchMe:(id)sender;
-(IBAction)refreshWebView:(id)sender;
@property (weak, nonatomic) IBOutlet UIWebView *webview;
@property(nonatomic,retain) UIActivityIndicatorView *activityIndicator;
And in my .m file, I have this:
- (void)webViewDidStartLoad:(UIWebView *)webView {
[_activityIndicator startAnimating];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[_activityIndicator stopAnimating];
Why doesn’t this work? Do you have any ideas?
I solved it. I changed:
to