objective c - Newbie question -multiple parameters -
i trying implement private method takes nsmutabledictionary , player object parameters. private method, place exists in ".m" file.
it declared as
-(void) incrementscore: (nsmutabledictionary*) scoreboard forplayer: ( player* ) player {
and call follows :
[ self incrementscore:deucescore forplayer:p];
however,it won't compile -
may not response message -incrementscore:forplayer
i'm not sure error lies - need declare method in ".h" file, or elsewhere in ".m" file, or have got syntax wrong?
the compiler needs find declaration method somewhere before use it. done in 3 way:
- declare method in (public)
@interface
class in.h
file . - declare method in class extension (a semi-private
@interface
, @ top of.m
files). - define method somewhere in
@implementation
before first use of it.
Comments
Post a Comment