I'm trying to write a custom macro that performs some action when called it.
Here is my constants file:
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
#define SHOW_VIEW [(AppDelegate*)[UIApplication sharedApplication].delegate showView]
#define HIDE_VIEW [(AppDelegate*)[UIApplication sharedApplication].delegate hideView]
and I created a pch file:
#ifndef MYPrefixHeader_pch
#define MYPrefixHeader_pch
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
#ifdef __OBJC__
#import "MYGlobals.h"
#endif
#endif /* MYPrefixHeader_pch */
and in my view controller, I'm trying to call the macro:
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
SHOW_VIEW;
}
And I see errors on the line SHOW_VIEW :