我正在使用以下代码创建一个静态方法来返回 DashboardMainMenuViewController。在接口 .h 文件中,我收到一条错误消息,指出期望类型。
+(DashboardMainMenuViewController *) dashboardMainMenuController;
+(DashboardMainMenuViewController *) dashboardMainMenuController
{
UISplitViewController *splitViewController = (UISplitViewController *) [[[self appDelegate] window] rootViewController];
NSArray *navigationControllers = [splitViewController viewControllers];
NSArray *viewControllers = [[navigationControllers objectAtIndex:0] viewControllers];
return (DashboardMainMenuViewController *) [viewControllers objectAtIndex:0];
}