-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,263
  • 5
  • 60
  • 71
Edward Hasted
  • 2,963
  • 8
  • 28
  • 45

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
  • 161,681
  • 23
  • 270
  • 358