Lập trình Wrox Professional Xcode 3 cho Mac OS part 64

484 ❘ CHAPĐể xóa một biểu thức, chọn nó trong cửa sổ biểu thức và bấm phím Delete. Biểu thức rất hữu ích cho việc kiểm tra các nội dung của các giá trị mảng. Một biểu hiện giống như đống [1] xem xét các yếu tố thứ hai trong các ngăn xếp mảng. Các bộ đệm biểu [chỉ mục] xem xét bất cứ phần tử chỉ số biến dùng để 18 DEBUGGING To delete an expression, select it in the Expressions window and press the Delete key. Expressions are very useful for examining the contents of array values. An expression like. | 484 CHAPTER 18 DEBUGGING To delete an expression select it in the Expressions window and press the Delete key. Expressions are very useful for examining the contents of array values. An expression like stack 1 examines the second element in the stack array. The expression buffer index examines whichever element the variable index refers to. DATA FORMATTERS The summary column in the variables pane is designed to present a compact informative explanation of the value or object. For some objects like strings the summary value is obvious. For objects like a collection it might display the size of the collection not a lot of detail but still informative. For an opaque FSRef structure it might convert that structure into a readable filename very informative indeed. This descriptive transformation is done using data formatters. Xcode includes many data formatters but they won t help with any object that you define. You can create your own data formatters to summarize complex data structures and objects in the debugger. Creating a Custom Data Formatter Creating your own data formatters is very easy. It is really nothing more than a format string with placeholders for values or expressions derived from the variable being summarized. Any regular text in the data formatter is displayed verbatim. There are two kinds of placeholders references and expressions. References are delimited by two percent characters reference . A reference can refer to a single member variable by name. If the variable is contained in a substructure use the appropriate period . separated variable name. You cannot use operators such as pointer dereferences or array indexes. For that you need to use an expression. Taking the class that s defined in Listing 18-3 the reference to the integer record_no of DataBlock class would be header. record_no . LISTING 18-3 Sample class Available tor download on typedef struct y 1 int record_no unsigned long checksum BlockHeader interface DataBlock NSObject .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
10    81    2    26-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.