My code in a UITableViewController:
delegate.myData = [myData objectAtIndex:indexPath.row];
How can I see the values of delegate.myData
or indexPath.row
in the Debugger? delegate.myData
should be an array and indexPath.row
an int
. I can only see memory addresses of the objects delegate
and indexPath
but where are myData
and row
?
Hover over a variable to see its value. The most commonly used way to look at variables is the DataTip. When stopped in the debugger hover the mouse cursor over the variable you want to look at. The DataTip will appear showing you the value of that variable.
Select a variable and click the Quick Look button to see a preview of the variable, click the Print Description button to print a description of the object in the console.
Print a variableClick the Add Action button and select Debugger Command. Put any print command in a debug console in a text field. Make sure you prefix it with po , e.g., po print(view) . Check Automatically continue after evaluating actions.
Check this How to view contents of NSDictionary variable in Xcode debugger?
I also use
po variableName print variableName
in Console.
In your case it is possible to execute
print [myData objectAtIndex:indexPath.row]
or
po [myData objectAtIndex:indexPath.row]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With