ios - "No visible interface" for existing method -
this .h file:
@interface test1viewcontroller : uiviewcontroller{} -(void)function1:(nsstring *)param1:(nsstring *)param2 ; @end
here .m file:
- (void)viewdidload{ [super viewdidload]; // additional setup after loading view, typically nib. [self function1:@"333" param2:@"sadfas"]; } -(void)function1:(nsstring *)param1:(nsstring *)param2 { }
this line of code gives me error, stating: no visible @interface .... declares selector 'function1:param2:
[self function1:@"333" param2:@"sadfas" ];
i tried modify bit, not work. how fix this
the function should be
- (void)functionwithfirstparam:(nsstring *)param1 andsecondparam:(nsstring *)param2;
param1
, param2
variables sending.
thus you'll have access passed string such:
- (void)functionwithfirstparam:(nsstring *)param1 andsecondparam:(nsstring *)param2 { nslog(@"param1: %@, param2: %@",param1, param2); }
and you'll call function this:
[self functionwithfirstparam:@"hello" andsecondparam:@"world"];
Comments
Post a Comment