Tauquir
Tauquir

Reputation: 6913

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

-(void) callme {
//statements
here I call another method "callmeagain"
}

}

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

Upvotes: 0

Views: 408

Answers (2)

Erle
Erle

Reputation: 171

Another Method could be

[self performSelector:@selector(callmeagain)]; 

It is basically the same thing as Kenny's Suggestion

Upvotes: 1

kennytm
kennytm

Reputation: 523284

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

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

Upvotes: 5

Related Questions