如何使用宏检测多个 iPhone 操作系统(等于或大于)?
我正在尝试根据用户 iPhone 使用的操作系统来执行不同的操作。
目前我有以下内容,其中显示 - “如果设备是 3.1,则发布此消息”
#ifdef __IPHONE_3_1
NSLog(@"this device is 3.1");
#endif
但是,我怎样才能让它说 - “如果设备是 3.1 或更高版本,则发布此消息” ?
非常感谢。
I am trying to execute different things depending on what os the users iPhone is using.
Currently I have the below, which says - "if the device is 3.1, post this message"
#ifdef __IPHONE_3_1
NSLog(@"this device is 3.1");
#endif
But, How can I get it to say - "If the device is 3.1 or higher, post this message" ?
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅如何定位特定 iPhone 版本?
See How to target a specific iPhone version?
嗯,这似乎可以做到。
我不知道为什么,因为对我来说,它是 - “如果操作系统版本大于或等于 3.2”
但是,它返回 - “如果 iPhone 操作系统低于 3.2”
谁能解释这实际上意味着什么?
Well this seems to do it.
I don't know why though because, to me, it reads - " if the OS version is greater than or equal to 3.2"
But, it returns - "if the iPhone OS is below 3.2"
Can anyone explain what this actually means?