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

Get Objective-C Quick Syntax Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.