【发布时间】:2012-06-05 19:20:08
【问题描述】:
我有一个方法,当我想设置一个参数(类型是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;
有什么问题??
谢谢!!
【问题讨论】:
-
首先,错误信息是什么?
-
playerScore是如何声明的? -
playScore 声明如下:@property (nonatomic, assign) int *playerScore;
标签: objective-c xcode methods int