为什么我无法在调试器中打印文本字段的文本intValue
?
Printing description of textField:
<UITextField: 0x8e65550; frame = (87 11; 194 18); text = '2'; autoresize = W+RM+H+BM; tag = 5; layer = <CALayer: 0x8e64040>>
(lldb) po textField.text.intValue
error: property 'text' not found on object of type 'UITextField *'
error: 1 errors parsing expression
(lldb) po textField.text
error: property 'text' not found on object of type 'UITextField *'
error: 1 errors parsing expression
(lldb) po textField
(UITextField *) $15 = 0x08e65550 <UITextField: 0x8e65550; frame = (87 11; 194 18); text = '2'; autoresize = W+RM+H+BM; tag = 5; layer = <CALayer: 0x8e64040>>
答案 0 :(得分:2)
您可以在调试器中使用的语法并不总是与您在源中使用的语法完全相同,并且LLDB仍在进行中。双点使用点语法似乎让人感到困惑。尝试使用括号语法:
(lldb) po [[textField text] intValue]