Are multiple lines in a header file allowed for text / strings?
I want to do this:
#define kDescriptionText @"Some text here..."
"...and more continued here."
I've also tried:
@"...and more continued here."
Is this possible? Or 开发者_如何学Gomust it all be on one looooooong line?
Use a backslash, as in here:
NSLog(@"Some text here...\
Some text here...");
Since I can't put code in a comment, here's Paul's suggestion for the define
#define BLAH @"this is a \
long string"
which worked for me.
Make sure there are no characters (including spaces) after the backslash.
I prefer:
#define FOO @"hgdhjdlhd" \
"gfgfgfd"
Or
NSString* const kFoo = @"gfsdhg"
"grgfsdgfsd";
精彩评论