开发者

error in synthesizing variable and implementing method

I'm getting error when synthesizing variable '@synthes开发者_运维技巧ize property must be in implementation context' and for method 'Method definition not in @implementation context' how should i resolve it? Thank you


Put all your class method and @synthesize variable between @implementation and @end in your .m (implementation) file .

@implementation MyClass

@synthesize myVar1,myVar2,myVar3;

-(void) method1:(id) myVariable
{

}

-(void) method2
{

}

@end 


From error description I guess you've put @synthesize directive outside of class implementation, i.e. make sure that it goes after @implementation in you file:

@implementation MyClass

@synthesize myVar;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜