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.
我有一个在 UIPrintInfo 中使用的 iPad 应用程序(iOS 4.2 及更高版本支持该应用程序)。我希望我的应用程序可以在以前的 iOS 版本(例如 3.2)上运行。如何在我的代码中检测设备的 iOS 版本并根据设备的版本进行必要的更改?
提前致谢,
Class printInfoClass = NSClassFromString(@"UIPrintInfo"); if (printInfoClass != nil ) { id printInfo = [printInfoClass printInfo]; // Do something }
采用
[[UIDevice currentDevice] systemVersion]