Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: @synthesize

In my AppDelegate.h file i written the following code

@interface iBountyHunterAppDelegate : NSObject <UIApplicationDelegate> {
    UITabBarController *tabcontroller;

}
@property (nonatomic,retain) IBOutlet UITabBarController *tabcontroller;

and in AppDelegate.h file I synthesize it.

@synthesize tabcontroller;

but in @synthesize line i get an error and the msg is: "MISSING CONTEXT FOR PROPERTY IMPLEMENTATION DECLARATION"

can anyone tell me how to solve it?

like image 665
iPhone Avatar asked Dec 16 '22 11:12

iPhone


2 Answers

I suspect you have put the @synthesize outside of your @implementation. It should look something like this

//  iBountyHunterAppDelegate.m

#import "iBountyHunterAppDelegate.h"

@implementation iBountyHunterAppDelegate

@synthesize tabcontroller; // note that this is between @implementation and @end

// other stuff

@end
like image 63
JeremyP Avatar answered Dec 31 '22 13:12

JeremyP


"and in AppDelegate.h file I synthesize it." Probably it´s just misspelled but it has to be in .m file :P

like image 31
Mobile Developer Avatar answered Dec 31 '22 13:12

Mobile Developer