简体   繁体   English

在使用Three20的Xcode中,TTIsPad()会做什么?

[英]what dows TTIsPad() do in Xcode using Three20?

i'm using Three20 in XCode but i copied a piece of code like this: 我在XCode中使用Three20,但是我复制了一段代码,如下所示:

if (TTIsPad()) {
    SplitCatalogController* controller =
        (SplitCatalogController*)[[TTNavigator navigator] viewControllerForURL:@"tt://catalog"];

    SplitCatalogController* controller =
        (SplitCatalogController*)[[TTNavigator navigator] viewControllerForURL:@"tt://catalog"];
    TTDASSERT([controller isKindOfClass:[SplitCatalogController class]]);
    map = controller.rightNavigator.URLMap;
}

But i don't know what does the function TTIsPad do, please help me. 但是我不知道TTIsPad的功能是什么,请帮帮我。

It is a convenience method that returns true if the current device is an iPad, and false otherwise. 这是一种便捷方法,如果当前设备是iPad,则返回true,否则返回false。

The source can be found here . 来源可以在这里找到。 It first checks whether the device is running iOS 3.2 or greater. 它首先检查设备是否正在运行iOS 3.2或更高版本。 If not, it returns false (iPads shipped with 3.2) If it is greater than 3.2, it returns the result of (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) which is true only if the device is an iPad. 如果不是,则返回false(3.2附带的iPad)。如果大于3.2,则返回(UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad)的结果,仅当该设备是iPad时为true。

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

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