Is this the correct way of refreshing the drawing in a different view?

≯℡__Kan透↙ 提交于 2019-12-11 15:25:39

问题


  • 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!