I would like to share with you a method to view the object instance variables during command line debugging.

Source: Internet
Author: User

From: http://www.cocoachina.com/bbs/read.php? Tid = 30607

Nslog is a common method for checking the value of a variable during debugging.ProgramWhat should I do if I am too lazy to re-compile nslog? At this time, I can use the command line to achieve the same functions as nslog.

Po is the information of the output object. It can only view the pointer address of an object. for example, if an object refers to a 0x13242 object address, you can view part of the object information through the Po object or the direct Po 0x13242 method.

However, the information that the PO can view is limited, and this cannot be used to view reverse return values such as frame or retaincount.
Print is required. for example, to view retaincount of object A, input print (INT) [A retaincount] in the command line during debugging. or print (cgrect) [A frame] to view the frame of object.
In addition, A. Frame usually does not respond during debugging, while print (cgrect) A. _ frame does.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.