Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Summary

Programming a Mac is similar to programming other types of computers in many ways yet also is different in ways designed to make programming easier. One major difference is that traditional programming forces you to create a single main program and fill it with code. Xcode automatically creates a main program for you, which you'll never need to modify or even look at. Instead of filling your main program with code, Xcode lets you store your code in separate files, which can run when a certain event occurs.

Like all programming languages, Objective-C uses a combination of symbols and commands that look like complete words. To define the end of each line of code, you must use a semicolon. To define a block of code, you use curly brackets. To give special instructions to the Xcode compiler, you need to use the # symbol. For leaving comments directly in your code, you use the // and /* and */ symbols for multiple lines.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial