iPhone Dev:从子控制器和TabBar中的另一个控制器重新加载表视图的数据 [英] iPhone Dev: Reload data of a table view from a child controller and another controller in a TabBar

查看:124
本文介绍了iPhone Dev:从子控制器和TabBar中的另一个控制器重新加载表视图的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现一个Notes管理器应用程序,它在tabBar中有一个tableView,其中显示了其注释的主要信息。访问一个笔记时,您可以编辑其属性。在tabBar的一个按钮中,您可以选择在tableView中显示注释的方式。

I'm implementing a notes manager application which has a tableView in a tabBar where the main information of its notes is displayed. When accessing to one note, you can edit its properties. In one button of the tabBar you can choose the way the notes are displayed in the tableView.

我遇到的问题是我不知道如何从子控制器或tabBar的其他控制器重新加载数据。我不知道如何从它们引用tableView,所以我可以使用reloadData从它们更新TableView的信息。

The problem I have is that I don't know how to reload the data from a child controller or from the other controller of the tabBar, either. I don't know how to refer to tableView from them so I can use reloadData to update the information of the TableView from them.

我是iPhone开发的新手......真的很感激任何帮助。

I'm quite new in iPhone development... any help will be really appreciated.

推荐答案

你应该试试 NSNotificationCenter

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doSomething:) name:@"doSomethingNotification" object:nil];

[[NSNotificationCenter defaultCenter] postNotificationName:@"doSomethingNotification" object:nil];

这篇关于iPhone Dev:从子控制器和TabBar中的另一个控制器重新加载表视图的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆