Search code examples
iosactivity-indicator

Activity Indicator not working when called from rootVC


I have a rootVC in which i have a view called loadingView and an activityIndicator in loadingView. The problem is that when i called the loadingView into another VC that inherit VC, the loadingView is nil...Does anybody know? Thanks.


Solution

  • So the problem is you are added loadingView to the xib of parent rootVC here, and creating a child view controller instance with its own xib. So the parent xib is not loaded and loadingView will be nil. Either create loadingView programatically or use progress hud libraries.