I am developing an application, and at some point I have a few uitableview. I want to know outside the delegate methods, for example, the action if there is a selected cell in tableviews and which one.
I tried to use: (NSIndexPath *)indexPathForSelectedRowbut it does not work, because if I do not have a selected cell, it [(NSIndexPath *) row]returns "0" and not nil
(NSIndexPath *)indexPathForSelectedRow
[(NSIndexPath *) row]
Could you help me?
thank..
- indexPathForSelectedRow nil, . , 0, , , :
NSIndexPath *path = [table indexPathForSelectedRow]; if (path){ row = [path row]; ... } else{ // No cell selected }
P.S. nil - 0, .