objective c - setting method with int -
i have method , when want set argument(which type int
) error message. code:
@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; }
i error in line:
self.playerscore = score;
what problem??
thanks!!
you declared property pointer int (that is, int *
) rather int (which int
). despite both including keyword int
, different things.
Comments
Post a Comment