开发者

Cell Specific data on pushViewController

开发者 https://www.devze.com 2023-02-18 05:17 出处:网络
I have an NSMutableArray which does some processing and eventually has several objects although the exact number of objects cannot be predefined.

I have an NSMutableArray which does some processing and eventually has several objects although the exact number of objects cannot be predefined.

The objects from this NSMutableArray are then displayed on a UITableView, with each cell representing an object in the NSMutableArray..

What i want to do is simple. i want to select a specific cell and then be sent to a new view which has data specific to that object that is in the array. i have read about pushViewController and it seems like it would be the way to this, however in the view that gets pushed 开发者_高级运维when a cell is selected, i want there to be a simple textbox (that the user can edit) that has data specific to that cell/object..

As i cant make any nib files for the pushViewController (because the data in the array is not the same every time), what can i do to:

  1. Push cell specific viewcontroller.
  2. allow user to edit this textbox.
  3. save textbox data and somehow connect to cell/object from nsmutablearray.
  4. when pushviewcontroller is called, cell/object specific data is loaded from somewhere.


You could, for example, create a property on your child view controller and retrieve the item from the parent view. I assume that you use something like a UITableView as the parent, so you can get the index for the selected item with the indexPathForSelectedRow message.

0

精彩评论

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