Hi, i have 2 class: main.m second.m.
If i have in main.m
- (void)ok
{
NSString *myString = @"OK!";
return myString;
}
How to call myString or "-(void) ok" function from second.m? Thanks.
Hi, i have 2 class: main.m second.m.
If i have in main.m
- (void)ok
{
NSString *myString = @"OK!";
return myString;
}
How to call myString or "-(void) ok" function from second.m? Thanks.
somewhere in second.m and assuming main.h/m defines a "Main" class
Main *m = [[Main alloc] init];
NSString *mString = [m ok];
//Do Stuff
[m release];
However, based on the fact that your example returns void and not NSString
, I think you have some basic knowledge to gain first. I'm guessing you don't understand Interfaces and Implementations yet, etc.
I would suggest starting with a good basic tutorial.