Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

xcode

ios

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
like image 916
Ashan Marla Avatar asked May 31 '26 11:05

Ashan Marla


1 Answers

This error may also come up if your class inherits from another custom class and if you used a forward declaration of your ancestor class (@class MyAncestorClass) in your header file, but forgot to #import your ancestor class in the implementation file.

like image 185
skh Avatar answered Jun 02 '26 03:06

skh