“Variable Undeclared” error when compiling to iOS Device, but not for Simulator

后端 未结 10 1338
时光取名叫无心
时光取名叫无心 2020-12-31 10:15

I have an custom UIVIewController that is the base class for other controllers and has an instance of a custom UIView variable that is accessed by inherited the classes.

10条回答
  •  攒了一身酷
    2020-12-31 10:57

    Do a clean and build, and also make sure you are not specifying a specific framework search path in the build settings. If you leave it empty you should get the correct libraries. well I don't know, should work.

    BaseViewController.h

    @interface BaseViewController : UIViewController {
        UIView *_vwHeader;
    }
    @property(nonatomic,retain)UIView *_vwHeader;
    @end
    

    BaseViewController.m

    @synthesize _vwHeader;
    

    CustomViewController.m

    #import "CustomViewController.h"
    @implementation CustomViewController
    
    - (void)loadView
    {
        [super loadView];
    
        [self._vwHeader setHidden:NO];
    }
    

    @end

提交回复
热议问题