The po
expects an object (print object). If you need the value of a primitive such as an int
, write only p myintname
to the console.
How can I print out the value of an int in xcode debugger?
-
03-10-2022 - |
Question
I have a UItableView where the user is selecting the first row, my indexPath is showing ( 0 - 0) and I try to se my int to indexPath.row. However when I try to do this when I log it using po myintname it returns <nil>
to the console.
This is what my code looks like.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"%@", indexPath);
int tempIndexPathRow = indexPath.row;
selectedItemIndexPathRow = tempIndexPathRow;
}
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow