I have a button and would like to know its enabled state while stepping through code. This doesn’t work in the debugger:
po self.myButton.enabled
It prints:
There is no member named enabled.
Is there another way to print out its state?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
gdb doesn’t know dot-syntax for properties, but it will evaluate method calls. -[UIButton enabled] returns a BOOL, which is a scalar type, not an object, so you should use
pwith a type cast, like this:If the property you want to inspect is an object, you can use
powithout the type cast, like this: