开发者

Mapping a dataset to textfield inside UItableView

开发者 https://www.devze.com 2023-02-27 09:43 出处:网络
In my app, I am using some .net asmx services (as backend) to get some data and populating it on my views. In one of the modules, i need to edit and save the data which am getting from the services.In

In my app, I am using some .net asmx services (as backend) to get some data and populating it on my views. In one of the modules, i need to edit and save the data which am getting from the services.In that am getting several rowkeyvalues and accordingly am creating those many row cells in my tableview, which consists two UItextfields as well, which displays some unique code and comments.

Now if I have to edit and save some fields, I need to map each one of those rowkeys to each row cell and after that am creating object which is basically the wsdl proxy class which I have generated using Sudzc and pass each dataset and serialize it to XML and POST it t开发者_开发百科hrough SOAP.

The real problem here, am not getting how to map each unique rowkeys to each row cell and create unique dataset(which mainly contains other fields as well including rowkey) for each row and pass it to proxy object (WSDL stubs).


Not sure I understand your problem, but there are 2 ways I can think of to map a row cell to something. 1. Each UITableViewCell is a subclass of UIView, and so it has a "tag" attribute, which is an int. You can set this and check it's value. 2. When a user taps a row, the tableView:didSelectRowAtIndexPath: is called. IndexPath.row is an int that gives the absolute row postiion within it's section (and if only one section, then in the whole table).

Usually, in cellForRowAtIndexPath: you fetch your backing data corresponding to the IndexPath.row and populate the cell. You could also set the cell's tag at that point.

This ties together the row, the cell and the data. Hope that helps. -Mike

0

精彩评论

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

关注公众号