Skip to Main Content
Objective-C® For Dummies®
book

Objective-C® For Dummies®

by Neal Goldstein
October 2009
Beginner content levelBeginner
456 pages
8h 59m
English
For Dummies
Content preview from Objective-C® For Dummies®

Chapter 4. Language and Programming Basics

In This Chapter

  • Getting a handle on statements

  • Working with variables

  • Performing actions with operators

  • Knowing how to make logical decisions in your code

  • Using pointers to access data

  • Getting the hang of using constants

  • Being aware of the Objective-C reserved words

As I mention in Chapter 3, Objective-C is a set of extensions to standard ANSI C. This means that at some point (that is, this chapter), you'll have to sit down and learn the basics of the C instruction set, along with some less than inspiring examples and detailed explanations on the basics of the language — kind of like learning your alphabet. I know all this can be tedious and excruciatingly boring, although when you're just starting out there's no other way (we all have to pay our dues at some point). But once you are done with this chapter, you will switch to learning Objective-C by developing a "real world" application, which I promise is (for the most part) much more interesting. So hang in there.

It All Comes Down to Your Statements

At the end of the day, it's all about the instructions you give the computer. Those instructions are called statements. You can easily recognize a statement because it ends with a semicolon, as shown here:

NSLog(@"This is a statement");

There are a number of different kinds of statements. In this chapter, I show you two of them:

  • Declarations of a variable allow space for data. They look something like this:

    int aNumber;

    Declarations are used to allocate ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Objective-C

Objective-C

Jiva DeVoe
Cocoa in a Nutshell

Cocoa in a Nutshell

Michael Beam, James Duncan Davidson

Publisher Resources

ISBN: 9780470522752Purchase book