Without more info I can't say exactly. First, you must have something like:
Code:
-(NSString *)test:(NSString *)str;
In the header (.h) file.
Second, wouldn't you call this like:
Code:
myOtherOtherString = [testStr test:otherStr];
Third, if you call this from within the object itself you would probably do something like:
Code:
myOtherOtherString = [self test:otherString];
Honestly, I work with enough different languages every day I can't remember if objective C would let you do:
Without it being defined like:
Code:
-(void)test:(NSString *)str;
My guess is no.
From rereading your post, you just seem confused. To do what you are doing you would have to setup a class named something different like "MySuperNSString" that subclasses NSString. Then you could init a MySuperNSString object that would have all the methods of the traditional NSString object but could also call a "test" method.
Your code defines a method that returns a NSString and takes an NSString for input, not adds a "test" method to the existing NSString. Like I said, I think you are confused:
Code:
-(NSString *)test:(NSString *)str; //NSString input, NSString output