Question

So say I created a class SoapService like so:

@implementation _SoapService
{
}

- (int)doStuff
{
    return 5;
}

@end

how would I create an instance of SoapService in another class to use the doStuff method (I realize the method doesn't really do much)

if that didn't make sense I want to do something like this if it were c#:

SoapService soap = new SoapService();

int i = soap.doStuff();

I'm having trouble finding any good beginner tutorials that are not just hello world.

Was it helpful?

Solution

SoapService *soap = [[SoapService alloc] init];
int i = [soap doStuff];

OTHER TIPS

SoapService *soap = [[SoapService alloc] init];

int i = [soap doStuff];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top