O'Reilly logo

Objective-C Quick Syntax Reference by Matthew Campbell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 3

image

Variables

Variables Defined

Objective-C stores information in variables. These are divided into two types: primitive types and composite types. Primitive variables store one piece of information, such as a number or a character. Composite variables store a set of information, such as three related numbers and a character.

Data Types

Table 3-1 shows the most common primitive data types that you will see in Objective-C.

Table 3-1. Objective-C Data Types

Data Type

Format Specifier

Description

NSInteger

%li

Signed integer

NSUInteger

%lu

Unsigned integer

BOOL

%i

Boolean (YES/NO)

CGFloat

%f

Floating point

 Note   Objective-C ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required