View Single Post
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,322
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
Quote:
Originally Posted by ad407 View Post
I have looked at several beginners books but I couldn't find anything concerning if statements and co-ordinates.

However, I have solved my problem with thanks to you so thank you! This has been bugging me for ages! Much appreciated!

- Arin
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
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
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.

Quote:
Originally Posted by Slydude View Post
I keep promising myself to explore programming more Can you suggest a few good resources? In the past when I have looked the books seem to assume that you know the basics.

I've kludged together a few very simple Applescripts and did a bit of Visual Basic programming for Excel a while back. Strictly stuff for my own use.
Objective-C brings object oriented programming 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 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:
https://developer.apple.com/library/...roduction.html
http://courseware.codeschool.com.s3....e_c_primer.pdf
Cocoa Dev Central: Learn Objective-C
https://www.makegameswith.us/tutoria...tive-c-primer/

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks