【问题标题】:Trying to get the intValue of a textfield's text in the debugger试图在调试器中获取文本字段文本的 intValue
【发布时间】:2012-04-01 17:55:54
【问题描述】:

为什么我不能在调试器中打印我的文本字段的文本 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>>

【问题讨论】:

  • 表示intValue不是文本的属性,文本是UILabel的属性

标签: objective-c debugging lldb


【解决方案1】:

您可以在调试器中使用的语法并不总是与您在源代码中使用的语法完全相同,并且 LLDB 仍在进行中。点语法的双重使用似乎使它感到困惑。尝试使用括号语法:

(lldb) po [[textField text] intValue]

【讨论】:

  • 是的,我正要发布我的答案:(lldb) po [textField text] (id) $24 = 0x088630b0 2. 谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-12-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多