开发者

How to call a method from another method in objective C?

开发者 https://www.devze.com 2023-01-10 23:06 出处:网络
-(voi开发者_如何学JAVAd) callme { //statements here I call another method \"callmeagain\" } } But it is not working. Is there another way to do it?To call an ObjC method, use the syntax [foo method
-(voi开发者_如何学JAVAd) callme {
//statements
here I call another method "callmeagain"
}

}

But it is not working. Is there another way to do it?


To call an ObjC method, use the syntax [foo methodName:param andAlso:param2 …] In your case, try

-(void)callme {
  [self callmeagain];
}


Another Method could be

[self performSelector:@selector(callmeagain)]; 

It is basically the same thing as Kenny's Suggestion

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号