Hi - I'm just starting out programming in Objective C and have little experience - forgive me if this is an obvious question.
Basically I've written a method that will set the value of a text view to the string passed to it as an argument.
- (void)setMainMessage
???)textToDisplay
{
[textView setStringValue: textToDisplay];
}
However I am unsure of how to pass the string that will be displayed to the method, in particular what data type to specify in the brackets above. In the past when passing an integer to a method I've simply used
- (void)setInteger
int)integerToDisplay;
Using NSString in the brackets throws up errors, I'm assuming because NSString is a class itself rather than a data type.
Any help would be really appreciated.
Thanks in advance, Thomas.
Basically I've written a method that will set the value of a text view to the string passed to it as an argument.
- (void)setMainMessage
{
[textView setStringValue: textToDisplay];
}
However I am unsure of how to pass the string that will be displayed to the method, in particular what data type to specify in the brackets above. In the past when passing an integer to a method I've simply used
- (void)setInteger
Using NSString in the brackets throws up errors, I'm assuming because NSString is a class itself rather than a data type.
Any help would be really appreciated.
Thanks in advance, Thomas.