objective c - Unrecognized selector sent to instance - why? -


ok have code class object called "game". every frame (60 fps) update object function gets string. after 5 seconds of running game i'm getting unrecognized selector sent instance error.

the update:

[game updateplayersandmonsters:@"0" monsters:@"0"]; 

the function:

-(void)updateplayersandmonsters:(nsstring*)players monsters:(nsstring*)monsters {     cclog(@"%@.%@", players, monsters); } 

i don't understand what's going on. error:

2011-07-03 12:13:19.175 app[65708:207] -[nscfstring updateplayersandmonsters:monsters:]: unrecognized selector sent instance 0xc4e95b0 2011-07-03 12:13:19.176 app[65708:207] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nscfstring updateplayersandmonsters:monsters:]: unrecognized selector sent instance 0xc4e95b0' 

what should do? thanks. idk if other details need, write if forget something, don't have idea.

update: gmae object of class gamenode:

    +(id) gmamenodewithmapid:(int)mapid_ scene:(somescene*)mainscene_ players:(nsstring*)cplayers_ monsters:(nsstring*)cmonsters_ monstercount:(nsstring*)monstercount_ {     return [[[self alloc] gmamenodewithmapid:mapid_ scene:mainscene_ players:cplayers_ monsters:cmonsters_ monstercount:monstercount_] autorelease]; } -(id) gmamenodewithmapid:(int)mapid scene:(somescene*)mainscene players:(nsstring*)cplayers monsters:(nsstring*)cmonsters monstercount:(nsstring*)monstercount {     if( (self=[super init])) { 

i create with:

game = [gamenode gmamenodewithmapid:choosenmapid scene:self players:thing[5] monsters:thing[6] monstercount:thing[4]]; 

update 2

i create somescene:

+(id) scene {     ccscene *s = [ccscene node];     id node = [somescene node];     [s addchild:node];     return s; } -(id) init {     if( (self=[super init])) { 

i use it:

[[ccdirector shareddirector] replacescene: [cctransitionradialcw transitionwithduration:1.0f scene:[loginscene scene]]]; 

'nsinvalidargumentexception', reason: '-[nscfstring updateplayersandmonsters:monsters:]: means tht trying send updateplayersandmonsters string object. reassigning game point else?


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -