【发布时间】:2012-08-06 17:50:00
【问题描述】:
我有一个 UIViewController 的子类,称为 SurveyQuestion。我为我的应用程序使用了这些数组。我用这条线得到了当前可见的控制器:
SurveyQuestion *currentQuestionController = [self.navigationController visibleViewController];
一切正常,但 Xcode 给了我一个警告
Incompatible pointer types initializing 'SurveyQuestion *__strong' with an expression of type 'UIViewController *'
我知道这是因为 visibleViewController 返回一个 UIViewController,但它可以工作,因为 SurveyQuestion 是一个 UIViewController。有没有办法抑制这个错误?还是我应该换一种方式?
【问题讨论】:
标签: objective-c ios xcode uiviewcontroller