iPhone – Why doesn’t this don’t apply to the Xcode debug window “PO [mynsdatecomponent weekday”

Why does this not apply to the XCode debug window “po [myNsDateComponent weekday]”?

Specific example:

(gdb) po weEndDayTime


( gdb) po [weEndDayTime weekday]
0x2 does not appear to point to a valid object.

The -weekday method of NSDateComponents returns an int. But po does not apply to primitive value types, only pointer types.

In this case, it outputs 0x2 as the integer of the method Convert to pointer and look for the object with pointer address 0x2. It can’t find anything, so it gives this information.

If necessary, use p instead of appropriate type conversion:

(gdb) p (int) [weEndDayTime weekday]
$1 = 2

Why does this not apply to XCode debugging Window “po [myNsDateComponent weekday]”?

Specific example:

(gdb) po weEndDayTime


( gdb) po [weEndDayTime weekday]
0x2 does not appear to point to a valid object.

The -weekday method of NSDateComponents returns an int. But po does not apply to primitive value types, only pointer types.

In this case, it converts the integer output 0x2 of the method to a pointer and looks for an object with a pointer address of 0x2 It can’t find anything, so it gives this information.

If needed, use p instead of the appropriate type conversion:

(gdb ) p (int) [weEndDayTime weekday]
$1 = 2

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1054 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.