Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法检测 UIlabel 中显示的字符总数。uilabels 文本来自 NSString。uilabel 是一个出口。任何帮助和示例将不胜感激!
yourOutletName.text.length将给出字符总数。
yourOutletName.text.length
你也可以用这个
NSString *myString=@"Sample"; NSUInteger characterCount = [myString length];