uitableview - How to find the row index of a UIButton is a TableCell? (iPhone) -


In my app, I have a table displaying cells in each row in the interface builder, I have a button on the cell Pulled, styled it as a dark info button, and it was linked to IBAction. It is working fine only, I want the button to behave differently, depending on the table row where the button is a cell, how do I get that line index?

I know that I can show the lack of basic understanding of the object hierarchy, but I hope you will forgive me

thanksgivingjackelian

It's not easy to make sure that you do not already have some data set up. If you can, then there are buttons in the NSDictionary where the buttons are key and the value is the index path, whenever you return a cell from the -tableView: cellForRowAtIndexPath: Update. Something like this:

  - (UITableViewCell *) TableView: (UITableView *) Table View CellForAind Pound: (NSIndexPath *) Index Path {... indexDict setValue: for indexPathKey: the Button]; Return cell; } - (Zero) button pressed: (UIButton *) button {NSIndexPath * indexPath = [indexDict valueForKey: button]; ...}  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -