Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Coordinate Dependent If Statements
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Raz0rEdge" data-source="post: 1579297" data-attributes="member: 110816"><p>You need to separate the two things. Look at the "if" statement as more like the following psuedo code:</p><p>[CODE]</p><p>if (expression is true)</p><p> do some work</p><p>else</p><p> do other work</p><p>[/CODE]</p><p></p><p>You can also chain a longer block with something like the following:</p><p>[CODE]</p><p>if (expression is true)</p><p> do some work</p><p>else if (another expression is true)</p><p> do other work</p><p>else</p><p> do default work</p><p>[/CODE]</p><p></p><p>Now in your case, the expression that I'm talking about here happens to be a check for the coordinates, but it could be anything else as well.</p><p></p><p></p><p></p><p>Objective-C brings <a href="http://en.wikipedia.org/wiki/Object-oriented_programming" target="_blank">object oriented programming</a> concepts to the good old C programming language. They differentiate the Objective-C part from traditional C by putting the commands in []..</p><p></p><p>So before attacking Obj-C and OOP programming, it's first good to get a solid grounding in regular C programming.</p><p></p><p>The following C Primer (outdated link removed) will help you get started. Once you have that grounding, you can start with a number of Objective-C primers that build on that. A lot of these Obj-C primers assume you know C well enough and only introduce the Obj-C pieces. If you get a proper book on Obj-C, they might introduce C, but at an accelerated pace though.</p><p></p><p>Check these out:</p><p><a href="https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html" target="_blank">About Objective-C</a></p><p><a href="http://courseware.codeschool.com.s3.amazonaws.com/try_ios/objective_c_primer.pdf" target="_blank">http://courseware.codeschool.com.s3.amazonaws.com/try_ios/objective_c_primer.pdf</a></p><p><a href="http://cocoadevcentral.com/d/learn_objectivec/" target="_blank">Cocoa Dev Central: Learn Objective-C</a></p><p><a href="https://www.makegameswith.us/tutorials/objective-c-and-debugging/objective-c-primer/" target="_blank">Make School | Mediabook</a></p></blockquote><p></p>
[QUOTE="Raz0rEdge, post: 1579297, member: 110816"] You need to separate the two things. Look at the "if" statement as more like the following psuedo code: [CODE] if (expression is true) do some work else do other work [/CODE] You can also chain a longer block with something like the following: [CODE] if (expression is true) do some work else if (another expression is true) do other work else do default work [/CODE] Now in your case, the expression that I'm talking about here happens to be a check for the coordinates, but it could be anything else as well. Objective-C brings [URL='http://en.wikipedia.org/wiki/Object-oriented_programming']object oriented programming[/URL] concepts to the good old C programming language. They differentiate the Objective-C part from traditional C by putting the commands in [].. So before attacking Obj-C and OOP programming, it's first good to get a solid grounding in regular C programming. The following C Primer (outdated link removed) will help you get started. Once you have that grounding, you can start with a number of Objective-C primers that build on that. A lot of these Obj-C primers assume you know C well enough and only introduce the Obj-C pieces. If you get a proper book on Obj-C, they might introduce C, but at an accelerated pace though. Check these out: [URL="https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html"]About Objective-C[/URL] [URL]http://courseware.codeschool.com.s3.amazonaws.com/try_ios/objective_c_primer.pdf[/URL] [URL='http://cocoadevcentral.com/d/learn_objectivec/']Cocoa Dev Central: Learn Objective-C[/URL] [URL="https://www.makegameswith.us/tutorials/objective-c-and-debugging/objective-c-primer/"]Make School | Mediabook[/URL] [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Coordinate Dependent If Statements
Top