简体   繁体   English

如何以编程方式确定我的应用程序正在iPhone,iPad或iPhone 4上运行?

[英]How can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4?

I just finish my iPhone game using cocos2d. 我刚刚使用cocos2d完成了iPhone游戏。 But before I put it on the AppStore, I'd like to make it work on iPad (which have a bigger screen) and iPhone 4 (which have a bigger resolution). 但是在将其发布到AppStore之前,我想使其在iPad(具有更大的屏幕)和iPhone 4(具有更大的分辨率)上运行。
So, how can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4, to be able to use the correct coordinates / images in my game? 因此,我如何以编程方式确定我的应用程序正在iPhone,iPad或iPhone 4上运行,以便能够在游戏中使用正确的坐标/图像?

Thanks for your help! 谢谢你的帮助!

Between iPad and iPhoneAlready answered many times . 在iPad和iPhone之间 - 已经 回答了 很多

Between iPhone and iPhone 4 — The size reported is still 320×480, so you don't need to change anything about the coordinates. 在iPhone和iPhone 4之间 -报告的大小仍为 320×480,因此您无需更改任何坐标。 Create an @2x alternative for the images if you need a high resolution UI image. 如果需要高分辨率的UI图像,请为图像创建@2x替代图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM