从视图访问UITableView,获取值并返回.(IPHONE) [英] Access UITableView from view,get a value and come back.(IPHONE)
问题描述
我有一个问题,我可以使用视图中可浏览到uitableview的普通按钮,从单元格获取值并设置文本标签(在第一个视图中)的方式这个值,然后使用后退按钮返回到第一个视图?
i've a problem, in which way could i access with a normal button that i've in a view to a uitableview, get a value from a cell and set a text label(that is in the first view) whit this value and then com back on the first view with a back button?
谢谢.
推荐答案
垫子
最简单的方法是将单元格中的值捕获到全局变量中(您可以在App Delegate或Singleton中设置全局变量),而所有按钮要做的就是抓住该变量的值,而不是进入UITableView来获取某个单元格值.
Easiest way is to just have the value in the cell be captured in a global varialble (you can set up global variables either in the App Delegate or in a Singleton) and that way all the button has to do is grab that variable's value instead of going into the UITableView to get a certain cell value.
Rob
p.s.好的阅读文章: http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html
p.s. a good article to read: http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html
这篇关于从视图访问UITableView,获取值并返回.(IPHONE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!