Quote:
Originally Posted by SteveMobs
Thanks a lot!
.. I just wonder where to find out about things like that, is it covered by any documentation?
|
Sort of. The one you found is mentioned here:
Mac Dev Center: The Objective-C Programming Language: Language Summary
The one I like is a side effect of C strings; if you put a bunch of C string constants in a row with only whitespace separating them you get a single C string, which gets processed by the @ directive.
The backslash stuff comes from C, which lets you continue any line by ending it with a backslash:
"A continued line is a line which ends with a backslash, \. The backslash is removed and the following line is joined with the current one. No space is inserted, so you may split a line anywhere, even in the middle of a word. (It is generally more readable to split lines only at white space.)"
Unfortunately there's a lot of C stuff that isn't covered in iPhone or Objective-C books, so it pays to keep a copy of
K&R handy.
Lurkers should note that *none* of these methods work if you're not dealing with constants. Every one of them works at compile time, not while the program is running.