Reputation: 243
I have a UIView that updates based on data in a certain object.
I'd like to be able to add a refresh button to my toolbar that reloads the object and redraws the view. I don't want it to happen every time so don't want to use viewWillAppear:
Sounds like it should be a popular thing to do but I can't seem to find any answers on here or the web.
Thanks in advance.
Upvotes: 2
Views: 3414
Reputation: 299355
If your underlying data has changed and the view needs to be redrawn to reflect this, send the view -setNeedsDisplay
, or -setNeedsDisplayInRect:
if you only need to update a part of the view.
Upvotes: 3