Skullhouseapps
Skullhouseapps

Reputation: 496

Can't find interface declaration for my IOS view controller

I'm getting this error: "Cannot find interface declaration for 'BaseViewController', superclass of 'ViewController'. Here's the situation:

AppDelegate:

BaseViewController

ViewController

The error doesn't make sense, as BaseViewController is imported in ViewController's header file. What is the problem here?

Upvotes: 8

Views: 18633

Answers (3)

Dearwolves
Dearwolves

Reputation: 453

Try adding

#import <UIKit/UIKit.h>

Upvotes: 12

kris
kris

Reputation: 2526

Also check for infinite loops in your import statements

Upvotes: 26

NWCoder
NWCoder

Reputation: 5266

Cannot find interface declaration for 'BaseViewController'

That error means that the compiler can't find the line that looks like this:

@interface BaseViewController : UIViewController

But I think it CAN find the BaseViewController.h (Or it would complain about that specifically)

I'd check that the spelling is the same including upper/lowercase?

Other than that, it should work as you'd expect.

Upvotes: 8

Related Questions