Xcode 4.3.2 gives error "cannot use super because it is a root class"

ios, xcode

Solution

When you declared your class, you probably forgot the superclass in the `@interface` line. For example, you did

@interface MyClass
{
    // ... ivars ...
}

// ... methods ...

@end

You want that first line to be:

@interface MyClass : NSObject

or whatever superclass you intended to use.

Problem

Lately when I updated to xcode 4.3.2 I've run into numerous new problems. In my app view controller m file, I keep getting the error "cannot use super because it is a root clause." I've looked on the internet for hours, so any help would be appreciated. Thanks ``` - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } @end ```

Original source