Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling a function inside the same class objective C

I am new to Objective C and I couldn t find resources on this subject at all

let s say I have a function Called A and a function called B , both belong to the same Class , how should I call function B inside of function A ? assuming they both belong to a Class called C

Thanks

like image 956
user1051935 Avatar asked Aug 04 '26 14:08

user1051935


2 Answers

//other code inside your project

-(void) functionA
{
NSLog(@"Hello"); // not sure if the syntax for this is right, but it should be

}

-(void) functionB
{
[self functionA];
}
like image 166
Gabriel Avatar answered Aug 06 '26 02:08

Gabriel


call [self B] in A.

This would be a good start: http://cocoadevcentral.com/

like image 38
Robert Kang Avatar answered Aug 06 '26 03:08

Robert Kang