3

While debugging an iOS application, I know how to print values of objects using :

print "variable name"
po    "variable name"

I wanted to know how to print values of variables which are not object-type, like for example NSInteger, int, float etc.

Thanks.

1 Answer 1

5

just use p intVar to print variables.
Sometimes you need to cast: p (CGRect)[[self view] frame]

Sign up to request clarification or add additional context in comments.

1 Comment

This is, indeed, the right solution. Also note that GDB has a printf function built-in too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.