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 > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-22-2009, 02:24 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 5
maxwell is on a distinguished road
Question Hi did anyone know about "?" in coding

HI everyone,
I am new to here, hope can learn more about objective C programming. I got a question I was stuck in the middle figure out what is use for so the code look like this : (switchView.on) ? @"IS on" : @"IS NOT on"
so just want to ask when do we use a question mark on coding.... or it use to omit something
???? thanks
maxwell is offline   Reply With Quote
Old 08-22-2009, 03:05 AM   #2 (permalink)
iPhone app Developer
 
Join Date: Jul 2009
Location: India
Age: 26
Posts: 36
brian is on a distinguished road
Send a message via Yahoo to brian Send a message via Skype™ to brian
Default yeah, that's just like a conditional statement

(switchView.on) ? @"IS on" : @"IS NOT on"

The syntax for this statement goes like this....

(condition) ? (statement to execute, if condition is TRUE) : (statement to execute, if condition is FALSE)

So, the '?' here is just for checking the condition....

I hope you got it..
brian is offline   Reply With Quote
Old 08-22-2009, 03:20 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 5
maxwell is on a distinguished road
Smile

Hi brian,
thank alot now I understand, I see it like writing if else condition. thank anyway I seldom came a cross this kind of condition now finally understand how it work...
maxwell is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 455
16 members and 439 guests
Domele, Duncan C, Feldspar, karatebasker, MacBook MH, Objective Zero, patapple, Paul Slocum, peterwilli, pipposanta, PixelInteractive, Punkjumper, rubyeim54, SLIC, taylor202, Today's Posts
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,694
Threads: 94,137
Posts: 402,950
Top Poster: BrianSlick (7,990)
Welcome to our newest member, peterwilli
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:02 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0