As far as I know the "tag" field in UIView is integer. Why one of my UIButtons has "nil" value in it's tag?
(lldb) po [button_one tag]
nil
I've set the tag 0 in designer, but still returns nil tag in code.
po means 'print object'. An integer isn't an object. And nil would be equal to an integer value of zero.
So, in lldb you should be using p to print the integer value. And it is probably correct.
My output is slightly different, but the point is, trying to print object on an integer (as Wain says) results in nil if the integer is 0 and an error if it is non-zero. (but in this case lldb still gives the p (int) value)
(lldb) po 0
$0 = 0 <nil>
(lldb) po nil
$1 = 0x00000000 <nil>
(lldb) po button.tag
$2 = 0 <nil>
(lldb) p (int)button.tag
(int) $3 = 0
Set the tag to 1
(lldb) po button.tag
$4 = 1 [no Objective-C description available]
(lldb) p (int)button.tag
(int) $5 = 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With