my question is how can i display the value of the selected item in a UITableView (index or the text value) in NSLo开发者_Python百科g i want to test on this value to select the right view thanks for your help
NSIndexPath has convenience int properties (section, row) for usage with UITableView, you can log them as follows:
NSLog(@"Section: %d, Row: %d", indexPath.section, indexPath.row);
you can just use
NSLog (@"%@", indexPath);
or if you are passing your indexPath to a NSIndexPath variable you can just replace indexPath with your variable name
NSLog (@"%@", myIndexPath);
your output should look like this
2011-10-07 09:32:16.996 myCode[3439:207] <NSIndexPath 0x4e3aeb0> 2 indexes [0, 3]
2011-10-07 09:32:16.997 myCode[3439:207] <NSIndexPath 0x4e3aeb0> 2 indexes [0, 3]
[Section, row]
精彩评论