优先选择 NSNumberFormatterBehavior10_4 而不是 NSNumberFormatterBehaviorDefault 是一个好主意吗?
我想知道依赖 NSNumberFormatterBehavior10_4 而不是默认值是否会更安全,因为默认值可能会在未来的某一天任意更改,突然间应用程序看起来很难看。还是我错了?
I wonder if it would be more secure to rely on a NSNumberFormatterBehavior10_4 instead of default, because default may change arbitrary some day in future, and suddenly the app looks ugly. Or am I wrong with that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 OS X 上,这两种操作模式的历史要归功于 10.4 中引入的基于标准开源库的更有用的行为。出于二进制兼容性的目的,如果您不执行任何其他操作,则将使用 10.4 之前的行为创建 NSNumberFormatters。
iOS 晚于 OS X 10.4 的发布,因此仅实现了 10.4 行为,并且是新的默认行为。由于没有遗留应用程序,因此没有理由实施 10.4 之前的行为。
根据在桌面上采取的方法(特别是该更改的设计是为了不破坏向后兼容性),我得出的结论是,声明您想要 10.4 而不是默认行为没有任何好处。
On OS X, the two operation modes owe their history to the introduction in 10.4 of more useful behaviour based on standard open source libraries. For the purposes of binary compatibility, if you don't otherwise do anything then NSNumberFormatters are created with pre-10.4 behaviour.
iOS postdates the launch of OS X 10.4, so only the 10.4 behaviour is implemented and is the new default. With no legacy apps, there is no reason for pre-10.4 behaviour ever to be implemented.
Based on the approach taken on the desktop — specifically that the change was designed explicitly not to break backwards compatibility — I'd conclude that there's no benefit to stating that you want 10.4 rather than default behaviour.