I\'ve a UITableViewCell
in a UITableViewController
.
In my cell there is a button that when you click takes you to another view
with a
Apple change the UITableViewCell hierarchy in iOS 7
Using iOS 6.1 SDK
|
| |
Using iOS 7 SDK
|
| |
| | |
So if you want to get indexpath at button index then use following code Using iOS 6 or later SDK
UITableViewCell *clickedCell = (UITableViewCell *)[[sender superview] superview];
NSIndexPath *clickedButtonPath = [book_table indexPathForCell:clickedCell];
NSLog(@"index=%@",clickedButtonPath);
Using iOS 7 or 7+ SDK
UITableViewCell *clickedCell = (UITableViewCell *)[[[sender superview] superview]superview];
NSIndexPath *clickedButtonPath = [book_table indexPathForCell:clickedCell];
NSLog(@"index=%ld",(long)clickedButtonPath.item);