Objective-C Built-in Data Types and New Data Types

The variables you declare in Objective-C, Objective-C data types, must be a type that the compiler can recognize. Objective-C comes with a number of built-in data types, as well as mechanisms to create new ones, for programming your iPhone or Mac OS X applications.


















































Built-In Types
TypeDescriptionSize
charA character1 byte
intAn integer — a whole number4 bytes
floatSingle precision floating point number4 bytes
DoubleDouble precision floating point number8 bytes
shortA short integer2 bytes
longA double short4 bytes
long longA double long8 bytes
BOOLBoolean (signed char)1 byte

Enumeration types


enum  typeName { identifier1, ... identifiern};

Identifiers are of constants of type int.

typedef


typedef  typeName  identifier;

Associates an identifier with a specific type.

Constants


const type  identifier  = value;
#define identifier value

Allows you to define names for constants.



dummies

Source:http://www.dummies.com/how-to/content/objectivec-builtin-data-types-and-new-data-types.html

No comments:

Post a Comment