HeisenBerg HeisenBerg - 6 months ago 51
iOS Question

Objective C Macro append to string

I think this is a very simple thing to do, but since I'm new to iOS development and objective C, I can't figure it out.

#define RESTFUL_PATH_PREFIX @"https://gogch.com/gch-restful";

I want the result

but I'm getting the result as

other topics in stackoverflow mention only about adding a new string to the beginning of a string like,

#define DOMAIN "example.com"
#define SUBDOMAIN "test." DOMAIN


Remove the trailing semi-colon:

#define RESTFUL_PATH_PREFIX @"https://gogch.com/gch-restful";

and then string constants can be concatenated by the compiler:

@"first" @"second"

instead of:

@"first"; @"second"