我有一个方法,当我想设置一个参数(类型是int
)时,我收到一条错误消息。我的代码:
@implementation PlayerInfo
@synthesize playerName;
@synthesize playerScore;
-(id) initPlayerInfo:(NSString*) name playerScore:(int) score
{
self = [super init];
if(self)
{
self.playerName = name;
self.playerScore = score;
}
return self;
}
我在这一行得到一个错误:
self.playerScore = score;
问题是什么??
谢谢!!