0

I have a BaseViewController that all my UiViewController extend.

This BaseViewController also uses AppDelegate and therefor I import it like this:

@interface BaseViewController : UIViewController{
    AppDelegate *appDelegate;  
}

In AppDelegate, I need to use a method applicationDidBecomeActive. In the method I would like to use a method of BaseViewController.

So I imported the BaseViewController:

#import "BaseViewController.h" but then I get a compilation error in BaseViewController :

Unkown type AppDelegate

What is wrong?

Dejell
  • 13,947
  • 40
  • 146
  • 229

1 Answers1

1

in your .h file, add this line:

@class AppDelegate

at top Then re-try

Vahid Farahmand
  • 2,528
  • 2
  • 14
  • 20