如何向 iPhone RSS 阅读器应用添加刷新按钮?
我正在使用上个月在 Web Designer 上获得的这个应用程序,它是一个非常基本的 RSS 阅读器。我想在顶部导航栏中添加一个刷新按钮,以刷新表中的所有内容,但似乎无法弄清楚如何做到这一点。我已经弄清楚它必须以某种方式使用 [tablename Reload] 函数,但不知道如何实现它。
我对这一切都很陌生,所以简单的说明就是很好的说明:)我知道如何添加按钮,将其链接到并定义用户单击它时我正在努力解决的操作。
您可以在此处获取代码 http://www.webdesignermag iPhone Apps 下的 .co.uk/tutorial-files/issue-162-tutorial-files/(这是唯一的一个)。
I'm playing around with this application I got on last months Web Designer that's a very basic RSS reader. I would like to add a refresh button to the top navigation bar that refreshes all the content in the table but can't seem to work out how to do it. I've worked out it must somehow use the [tablename Reload] function, but have got no idea how to implement it.
I'm new to all this so simple instructions are good instructions :) I know how to add the button, its linking it to and defining the actions when the user clicks it that I'm struggling with.
You can grab the code here http://www.webdesignermag.co.uk/tutorial-files/issue-162-tutorial-files/ under iPhone Apps (it's the only one).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是您需要在 RootViewController.m 中执行的操作:
在 viewDidLoad 函数中,添加一个 UIBarButtonSystemItemRefresh 类型的按钮,将其关联到一个 Action 和一个 Target,(事实上,正如 Alan 告诉您的那样,您需要了解渠道和行动)
实现刷新表函数(如果没有在.h中声明,必须将其放在viewDidLoad()之上)
This is what you need to do in the RootViewController.m:
In the viewDidLoad function, add a button of type UIBarButtonSystemItemRefresh, associate to it an Action and a Target, (infact, as Alan told you, you need to learn about Outlets and Actions)
Implement refreshTable function (if not declared in .h, have to put it above viewDidLoad())
嗨,格雷姆,欢迎来到 SO。
对于 iPhone UI,您必须定义插座和操作,并使用 Interface Builder 将它们链接在一起。
此页面包含一些希望可以帮助您入门的信息。
了解插座和操作
Hi Graeme and velcome to SO.
For the iphone UI, you have to define outlets and actions, and use Interface Builder to link them together.
This page has some information that should hopefully get you started.
Understanding Outlets and Actions