我正在为 iPhone 做一个计算器,在设备旋转时,会显示一个新视图,并且出现以下三个错误:
CalculatorAppDelegate.m:21:警告:不兼容的 Objective-C 类型'struct CalculatorViewController *',当从不同的 Objective-C 类型传递'setRootViewController:'的参数 1 时,预期的'struct UIViewController *'
此错误(及以下)来自代码:
self.window.rootViewController = self.viewController;
CalculatorAppDelegate.m:警告:语义问题:从“CalculatorViewController *”分配给“UIViewController *”的指针类型不兼容
以下错误来自:
UIInterfaceOrientation interfaceOrientation = [[object object] orientation];`
CalculatorViewController.m:警告:语义问题:从枚举类型“UIDeviceOrientation”到不同枚举类型“UIInterfaceOrientation”的隐式转换