Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-11-2010, 11:44 AM   #5 (permalink)
smasher
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

Quote:
Originally Posted by SteveMobs View Post
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.
__________________

Free Games!

Last edited by smasher; 02-11-2010 at 11:46 AM.
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,473
Threads: 94,038
Posts: 402,623
Top Poster: BrianSlick (7,978)
Welcome to our newest member, iram91417
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.