我在教程中看到了这个声明,其中有人正在更改 UITabBarController 的外观。
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
等号后面的第一部分有什么作用?更具体地说,
(UITabBarController *)
顺便问一下,更改 UI 外观时是否有某种相关类的概述?我很难弄清楚何时调用什么。
非常感谢!
最佳答案
这是一个typecast :(T)value
运算符强制进行从原始类型 value
到新类型 T
的显式类型转换。
关于ios - (UITabBarController *)self.window.rootViewController;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16509138/