I am new to Objective-C development and I have already run into the first problem. I am trying to write a function that takes a string as argument and compares that string with other strings. The pseudo code for the function would be the following:
String string2
String string3
function compare_string (String string) {
if (string == "a specific string" &&
string == string2 &&
string == string3) {
// do something
}
}
Until now I only have the following:
NSString *string2 = @"Second string";
NSString *string3 = @"Third string";
(void) compare_string: (NSString *) string {
but now I am already stuck because I don't know how to call the input string string inside the function. Should I simply do something like
if (string == string2) { ... }
or is there another way to use function arguments in Objective-C?