开发者

How can I detect which system my App Store application is running on?

I am developing a Cocoa Touch application for Apple's App sto开发者_运维百科re and I want to do some tweaking in the code depending on what device it's running on. How can I tell?


I've used this in a Universal app to determine if the code is running on an iPad

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 
{
    // Do iPad only stuff here
}


Check out the documentation for UIDevice


Look at UIDevice and it's properties. There is a systemVersion string that will work for what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜