-2

This should be simple but I'm clearly doing something painfully wrong. I want to write a test method that returns a string.

In my classTest.h I have

 @interface classTest : NSObject

 - (NSString *)returnTestString; 

 @end

classTest.m

- (NSString *)returnTestString; {
    NSString *currentTestString = @"123.456";
    return currentTestString;
}

and in the calling module.m I have #import "classTest.h" and then to call the module if I add [classTest returnTestString];

I get

"No known class method for selector 'callTestString'"

Can some point out the bleedin' obvious? - thanks EH

Groot
  • 13,943
  • 6
  • 61
  • 72
Edward Hasted
  • 3,201
  • 8
  • 30
  • 48

1 Answers1

2
 @interface ClassTest : NSObject // classes always begin w/capital letters.

 - (NSString *)returnTestString; 

 @end

You want to call that?

 ClassTest *ct = [[ClassTest alloc] init];
 [ct returnTestString];
bbum
  • 162,346
  • 23
  • 271
  • 359