问题
I've got a long string an sql statement, which I want to wrap onto the next line in the xcode editor, how do I wrap it round e.g.
[db executeUpdate:@"insert into test (rid, one, two, amount, startdate, recurrance) values (nil, ?, ?, ?, ?, ?)",
回答1:
Try:
[db executeUpdate:@"insert into test (rid, one, two, amount, values"
" startdate, recurrance)(nil, ?, ?, ?, ?, ?)",...
回答2:
I had similar issue... call me paranoid.. but i like my sqlstring to look pretty and easy to trace in case something went wrong i used the stringWithFormat
example:
NSString sqlString = [NSString stringWithFormat: @"%@ %@ %@ %@ %@",
@"SELECT name, address, phone",
@"FROM whateverDatabase",
@"LEFT JOIN ...",
@"WHERE ...",
@"AND ...."];
hopefully if this is what you are looking for (i figured i posted on the wrong page... maybe here is better)
来源:https://stackoverflow.com/questions/3778589/xcode-how-do-i-wrap-a-long-string-around-to-the-next-line-in-the-xcode-editor