Jules
Jules

Reputation: 7766

Xcode: How do I wrap a long string around to the next line in the xcode editor

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, ?, ?, ?, ?, ?)",

Upvotes: 3

Views: 1385

Answers (2)

supermantoby
supermantoby

Reputation: 21

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)

Upvotes: 0

Vladimir
Vladimir

Reputation: 170829

Try:

[db executeUpdate:@"insert into test (rid, one, two, amount, values"  
                   " startdate, recurrance)(nil, ?, ?, ?, ?, ?)",...

Upvotes: 6

Related Questions