There are two ways to split strings over multiple lines:
Using
All lines in C can be split into multiple lines using .
Plain C:
char *my_string = "Line 1
Line 2";
Objective-C:
NSString *my_string = @"Line1
Line2";
Better approach
There's a better approach that works just for strings.
Plain C:
char *my_string = "Line 1 "
"Line 2";
Objective-C:
NSString *my_string = @"Line1 "
"Line2"; // the second @ is optional
The second approach is better, because there isn't a lot of whitespace included. For a SQL query however, both are possible.
NOTE: With a #define, you have to add an extra '' to concatenate the two strings:
Plain C:
#define kMyString "Line 1"
"Line 2"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…