Saturday, April 25, 2009

Strings in Objective C: Multiline String Literal, String Concatenation and String Formating

Here is an example of it:
NSString* sql = [NSString stringWithFormat:@"select ID, aText, aFloat, aFloat2, "
"aText2 as myText2, aText3, 'aStringConstant' as myStringConstant "
"from myTable where afloat<=%1.6f and afloat2>=%1.6f Order by aText",
floatVariable, floatVariable2];

return [self executeQuery:[sql UTF8String]];

During my search I found this interesting blog.

Following link(s) were also helpful:
Java Developer’s Guide to String Constants in Objective-C


0 comments:

Post a Comment