[Solved] IOS: Add activity indicatior view in web view


I’m guessing your mySpinner ivar isn’t being properly retained or declared.

In your .h file, declare it as a property. That is:

@property (strong) UIActivityIndicatorView *mySpinner;

then, when you create it:

self.mySpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];

and when you reference it in your button click method:

[self.mySpinner startAnimating];

solved IOS: Add activity indicatior view in web view