问题
- Import the CustomView.h in the data controller header file
- Create an IBoutlet to my CustomView from there
- Connect that outlet instoryboard from the DataController to the CustomView
- Use that to call the view's setNeedsDisplay method.
Every time I add an item to the core data context I would like it to notify the CustomView (which lives in another tab) to redraw itself.
I am using ios5 and storyboards.
回答1:
Yep, the DataController should be notifying the view when it needs to refresh because the data has changed, so your implementation is sound.
来源:https://stackoverflow.com/questions/8695497/is-this-the-correct-way-of-refreshing-the-drawing-in-a-different-view