I'm using a common TabBar application where I got one viewController to get some calculus and one where I make some drawing开发者_如何学编程s from these results.
It works quite well for the first time with the ViewDidLoad method. But It doesn't refresh the other time when I change values in the first tab and I switch tabs.
The ViewWillAppear method doesn't seem to get called when I come back again in the graph viewController.
The drawing values are shared with a sigleton and I can refresh only with a lame push button for now. Does anyone know how to trigger properly the refresh automatically ?
Thank you in advance.
ViewWillAppear only gets called
...before the receiver’s view is about to be displayed onscreen and before any animations are configured for showing the view. -Apple Documentation
So I am assuming you are using text fields to receive the data from the user, yes? If so, you will need to refresh as soon as the user "enters" the text into the text field, either by pressing the Return button on the iOS keyboard or some other means(which ever way you have set it up). If you can provide more information I would be glad to further assist you.
精彩评论