开发者

How should I do this? (iOS plist editing and updating all controllers)

I am making an app which basically presents data (from plist) to user in table form. I have a lot of controllers and the user basically navigates through these controller to get to an item after which a final detail display is shown. At that last view, the user can add that to favorites.

The way that I am passing data to view controller is that I pass them specific data, so at the last view, if the user adds the item to favorites, I write that dat开发者_运维问答a to file. But how can I tell all my other controller that the data has updated? This is more of a design problem and I don't know where to go..I have some idea but I want to know what is the standard way of doing this...Thanks.


If you're going to be listening for events within multiple objects, take a look at NSNotificationCenter. You can simply subscribe to listen for notifications then post one once the data is updated.

NSNotificationCenter Class Reference

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜