How can I expand a macro inside NSString? I’ve got the following code:
#define MAX_MESSAGE_LENGTH 2000
NSString *alertTxt = @"Your message exceeded MAX_MESSAGE_LENGTH characters";
As you can predict I get “Your message exceeded MAX_MESSAGE_LENGTH characters” instead of “Your message exceeded 2000 characters”.
Is there a way to get my MAX_MESSAGE_LENGTH expanded in the string?
NSStrings works like C strings. I.e. you can concatenate string constants by writing them next to each other.