开发者

Reference to App Delegate "lost"

I have the strangest error in an app with a Root Viewcontroller containing a menu with 13 buttons to 13 separate viewcontrollers.

(All 13 are declared and initialized the same way in the App Delegate, and the Root view calls an App Delegate functions that pushes one of them on the Navcontroller stack. All view controllers load and are navigated to correctly.)

I just now copied a working viewcontroller's (of the 13) code for later adaptation to another tableview with different functionality. The only thing I've changed so far is the name of the .h and @interface and @implementation clauses so it will compile.

Suddenly, all the macros declared in the App Delegate (and that worked in the viewcontroller I copied the code from) give errors ('undeclared').

Importing AppDelegate.h fixes the .m file (edit: the .h file contains only 'local' macros), but I'm curious as to why it works without the import in one of the 13 and not in another of the 13 - as they are identically implemented!

It's obviously either some declaration difference or some difference in MainWindow.xib somehow, but I can see no differences!

So... what else could it be? Any ideas?

Edit: relevant code from AppDelegate.h: (I copied code from nyheterVC.h/m to narmastedepaVC.h/m)

@class foretagsinfoVC;
@class harfinnsviVC;
@class uthyrningVC;
@class utbildningVC;
@class nyheterVC;   
@class kontakterVC;
@class narmastedepaVC;
@class bruksanvisningarVC;
@class minabyggplatserVC;
@class minauppgifterVC; 
@class appTipsVC;   
@class heatworkDetail;
@class stripehogDetail;

    foretagsinfoVC *foretagsinfo;
    harfinnsviVC *harfinnsvi;
    uthyrningVC *uthyrning;
    utbildningVC *utbildning;
    nyheterVC *nyheter; 
    kontakterVC *kontakter;
    narmastedepaVC *narmastedepa;
    bruksanvisningarVC *bruksanvisningar;
    minabyggplatserVC *minabyggplatser;
    minauppgifterVC *minauppgifter;
    appTipsVC *apptips;
    heatworkDetail *heatwork;
    stripehogDetail *stripehog;

@property (nonatomic, retain) IBOutlet foretagsinfoVC *foretagsinfo;
@property (nonatomic, retain) IBOutlet harfinnsviVC *harfinnsvi;
@property (nonatomic, retain) IBOutlet uthyrningVC *uthyrning;
@property (nonatomic, retain) IBOutlet utbildningVC *utbildning;
@property (nonatomic, retain) IBOutlet nyheterVC *nyheter;  
@property (nonatomic, retain) IBOutlet kontakterVC *kontakter;
@property (nonatomic, retain) IBOutlet narmastedepaVC *narmastedepa;
@property (nonatomic, retain) IBOutlet bruksanvisningarVC *bruksanvisningar;
@property (nonatomic, retain) I开发者_高级运维BOutlet minabyggplatserVC *minabyggplatser;
@property (nonatomic, retain) IBOutlet minauppgifterVC *minauppgifter;
@property (nonatomic, retain) IBOutlet appTipsVC *apptips;
@property (nonatomic, retain) IBOutlet heatworkDetail *heatwork;
@property (nonatomic, retain) IBOutlet stripehogDetail *stripehog;


Well you need to check what was the difference in the AppDelegate.h file

Post some code here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜