【发布时间】:2016-07-04 01:59:29
【问题描述】:
ObjCPropertyRefExpr 0x7fc2f9a80ac0 '<pseudo-object type>' lvalue objcproperty Kind=PropertyRef Property="text" Messaging=Getter
`-OpaqueValueExpr 0x7fc2f9a80aa0 'UITextField *'
`-PseudoObjectExpr 0x7fc2f9a61d30 'UITextField *'
|-ObjCPropertyRefExpr 0x7fc2f9a61cb8 '<pseudo-object type>' lvalue objcproperty Kind=PropertyRef Property="txtFirstname" Messaging=Getter
| `-OpaqueValueExpr 0x7fc2f9a61c98 'EditInfoViewController *'
| `-ImplicitCastExpr 0x7fc2f9a61c50 'EditInfoViewController *' <LValueToRValue>
| `-DeclRefExpr 0x7fc2f9a61c28 'EditInfoViewController *const __strong' lvalue ImplicitParam 0x7fc2f9a61828 'self' 'EditInfoViewController *const __strong'
|-OpaqueValueExpr 0x7fc2f9a61c98 'EditInfoViewController *'
| `-ImplicitCastExpr 0x7fc2f9a61c50 'EditInfoViewController *' <LValueToRValue>
| `-DeclRefExpr 0x7fc2f9a61c28 'EditInfoViewController *const __strong' lvalue ImplicitParam 0x7fc2f9a61828 'self' 'EditInfoViewController *const __strong'
`-ImplicitCastExpr 0x7fc2f9a61d18 'UITextField *' <ARCReclaimReturnedObject>
`-ObjCMessageExpr 0x7fc2f9a61ce8 'UITextField *' selector=txtFirstname
`-OpaqueValueExpr 0x7fc2f9a61c98 'EditInfoViewController *'
`-ImplicitCastExpr 0x7fc2f9a61c50 'EditInfoViewController *' <LValueToRValue>
`-DeclRefExpr 0x7fc2f9a61c28 'EditInfoViewController *const __strong' lvalue ImplicitParam 0x7fc2f9a61828 'self' 'EditInfoViewController *const __strong'
鉴于上面的 AST,是否可以从 ObjCPropertyRefExpr 中获取元素“UITextField”?
现在我正在疯狂地尝试所有的 getter 方法,但到目前为止还没有运气好......任何建议都将不胜感激
【问题讨论】:
标签: ios objective-c clang abstract-syntax-tree llvm-clang