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

放肆的年华 提交于 2019-12-10 20:37:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!