Declaring CustomViewController?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-05-04T12:29:50Z Indexed on 2010/05/04 12:38 UTC
Read the original article Hit count: 430

Filed under:
|
|

I have noticed in some of my older apps that in situations where I have added a custom View Controller I have not changed the View Controller class in the application delegate. For example, below I have created a CustomViewController class but have declared viewController as UIViewController.

@interface ApplicationAppDelegate: NSObject <UIApplicationDelegate> {
    UIWindow *window;
    UIViewController *viewController;
}

My question is, both work, but for correctness should I be writing this as follows:

@class CustomViewController;
@interface ApplicationAppDelegate: NSObject <UIApplicationDelegate> {
    UIWindow *window;
    CustomViewController *viewController;
}

gary

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c