将 NSString 值分配给标签
我尝试将 NSString 中的值应用到 IB 中的标签。我看到的问题是,分配给标签的值是:
UITextField: 0x6d4e0f0; frame = (7 86; 97 31); text = '2'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; layer = CALayer: 0x6d4e210
我显然只想看到“2”而不是整个 UITextfield 数据。
有什么线索吗?
I have tried to apply the value from a NSString to a label in IB. The problem im seeing, is that the value assigne to the label is:
UITextField: 0x6d4e0f0; frame = (7 86; 97 31); text = '2'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; layer = CALayer: 0x6d4e210
I obviously would like to just see "2" rather than the whole UITextfield data.
Any clues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在你的标签中说:
而不是:
我的猜测是你传递整个 UITextField 对象,但你实际上只想传递它的 .text 部分。
对于您的评论:
In your label say:
Instead of:
My guess is your passing the whole UITextField object, but you really just want to pass the .text part of it.
For your comment: