Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Debugger: view value of variable

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?

alt text

like image 950
Manni Avatar asked Jan 19 '11 12:01

Manni


People also ask

How do you view the value of a variable?

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.

How do I display a variable in Xcode?

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.

How do I print a value in Xcode?

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.


1 Answers

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] 
like image 182
Andriy Avatar answered Sep 21 '22 15:09

Andriy