ios - RootViewController 不能使用 'super' 因为它是根类

标签 ios xcode xcode4 xcode4.2 xcode3to4

在学习使用基于导航的应用程序的教程时,我决定使用我的 3.2.6-Xcode 创建一个基于导航的应用程序,并使用 Xcode 4.2 打开它,以便按照该版本的教程进行操作。
但是当我在 Xcode 4.2 中打开同一个项目(不更改或添加任何代码)时,4.2 Xcode 给了我 2 个错误说:

RootViewController cannot use 'super' because it is a root class



现在,我的 Xcode 有 4 个类文件:RootViewController.h、RootViewController.m、SaveUpAppDelegate.h 和 SaveUpAppDelegate.m。错误在 RootViewController.m :
- (void)dealloc {
    [super dealloc];
}


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Relinquish ownership any cached data, images, etc that aren't in use.
}

我已经通过互联网搜索并找到了这个讨论(http://stackoverflow.com/questions/10113669/xcode-4-3-2-gives-error-cannot-use-super-because-it-is-a-root -class),他们说原因可能是 Controller 是开发人员忘记了 @interface 中的父类(super class)。线。这不适合我的情况,因为我(或更好:Xcode 3.2.6)没有忘记 RootViewController.h 中的父类(super class)...
#import <UIKit/UIKit.h>

@interface RootViewController : UITableViewController {
}

@end

现在,我将这些关键行注释掉了,它工作正常,但我敢肯定,我需要这些行,因为 m 文件中的大多数自动创建的行都是用 [super ....] 完成的。

如何解决问题?

最佳答案

我的决议更简单。 .m 文件中的#import "ClassHere.h"有拼写错误。这解决了我遇到的问题。

关于ios - RootViewController 不能使用 'super' 因为它是根类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10798637/

相关文章:

objective-c - 将 initWithFrame : trigger init?

Xcode4 自动生成@property 声明以及与之相关的所有内容

html - IOS7 中的 Canvas 外弹出菜单浓缩到页面中,而不是移出 Canvas

ios - 动画太快了。似乎不能放慢脚步

xcode - 来自调试器的消息 : unable to attach error for osx app

ios - Xcode 4 在异常时中断或使用良好的调用堆栈进行断言并打印异常

使用 LLVM2 编译时,iOS App 在 3.1.3 下崩溃

XCode 不导入 OS X 崩溃日志

ios - 如何防止用户共享他们的 apple id 进行应用内购买

IOS:是否可以同时录制压缩视频和未压缩音频