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.
我想弄清楚如何将 NSLengthFormatter 与 NSTextField 一起使用。输出应使用本地单位,但不显示单位。我尝试在代码和 setStringValue:@"22" 中手动设置格式化程序,但结果相同。我做错了什么?
格式化程序创建对象的文本表示形式和NSLengthFormatter采用双精度的方法。试试setObjectValue:@22.0。
NSLengthFormatter
setObjectValue:@22.0