I have a code which returns selected row for NStableView as under:
int status;
NSUInteger selectedRow = [tableView selectedRow];
if (selectedRow == 0)
return;
But, when i have not selected any row in table view or if the tableview is empty, it returns junk value. How can i tackle with this problem.
-selectedRowreturns signed integer and you’re using unsigned in your code. If there’s no row selected method returns -1, so you’re getting some overflowed value in your unsigned variable.