English 中文(简体)
如何使用表格 把价值观传给另一个观点控制者的看法?
原标题:How to use a tableView as a selector to send values to another viewcontroller?

我试图尽可能地解释这一点,但是如果它过于混淆,我会抱歉——现在我已多次在这个问题上 st。

In my application i have a search screen where the user will be able to select a bunch of criterias to perform the search by. Some of these criterias consists of fairly long lists of values to choose from and therefor i want a tableview on my searchscreen which have 4 rows - Each row representing a criteria that the user can set. Once the user clicks on a row i want to push a new window in my navigationcontroller which consists of a new table containing the selectable values for that criteria - Once the user clicks on one of these rows on the new window, i want the selected value to be sent back to my main searchscreen and pop back to my search screen.

这样做的最佳方式是什么?

My searchscreen is called SearchViewController and is contained in a navigationController. SearchViewController contains two sliders and a tableView with 4 rows called "Searchtype", "Property type", "Salestype", "Area" and a searchbutton. If the user clicks on "Searchtype" then i want a new view to be pushed in the navigationController which should contain a new tableView with a bunch of rows representing different possible values for the "Searchtype" criteria - The same goes for all 4 rows in SearchViewController. When the user clicks on one of the value rows in the newly pushed tableView i want that tableView to be popped away and the selected value sent back to the SearchViewController allowing the user to either select more criterias or push the search button to actually perform a search based on the selected criterias.

But i can t figure out the best way to do this? I really appreciate any help i can get - I m going nuts trying to figure this out :)

Btw. i no t use Interface Buildinger - All UI elements arecoded Manually.

“entergraph

最佳回答

5 在这里这样做的方法:

(1) 让搜索观点主计长担任搜索类型观察主计长的行动代表,以便在用户选择搜索类型时,将通知他。 如果你愿意,在汇编时间时使用适当的检查程序,并记住使用指派而不是为代表保留,以避免通知。

2) 召集美国航空局主计长代表,请见主计长(或你想要控制的任何阶层),并听取搜查类型主计长出席时的活动。

3) 鉴于WillAppear执行“refresh”职能:如上所述,但这不是建议,因为执行“WillAppear:cks”,根本不可靠。 也许对简单的评估是好的,但是,如果你所看到的结构变得复杂,就会忘记。

4) Use NSNotificationCenter. Your Search View Controller will observe all changes to search criteria, and in each child view controller, when the user changes it, post a notification. This is more complicated, but much more powerful and flexible than all the methods above.

5)同样,你可以使用核心数据储存物体的所有搜索标准,并听取使用KVO对该物体的改动。 这比以前更先进,可能超高,但如果你知道KVO,就会使目标C的生活更加容易,因此可能值得一看。

Btw:通过手提来理解概念,而试图在你能够的时候向Interface Buildinger移动,这有利于所有国际倡议。 这是一项非常建议的工作方式(在Stackoverflow或网上,这方面有无数的线索,对为什么国际局更好进行了更详尽的讨论)。

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签