Objective-C Programming For Dummies
Book image
Explore Book Buy On Amazon

Objective-C operators, like those in other programming languages, let you perform operations on variables (hence the name). Objective-C provides many operators, and keeping track of all of them can be difficult as you program your iOS or Mac OS X apps. Use the following tables to jog your memory as to which operator accomplishes what task.

Arithmetic Operators
Operator What It Does
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo
Relational and Equality Operators
Operator What It Does
== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
Logical Operators
Operator What It Does
! NOT
&& Logical AND
|| Logical OR
Compound Assignment Operators
Operator What It Does
+= Addition
-= Subtraction
*= Multiplication
/= Division
%= Modulo
&= Bitwise AND
|= Bitwise Inclusive OR
^= Exclusive OR
<<= Shift Left
>>= Shift Right
Increment and Decrement Operators
Operator What It Does
++ Increment
-- Decrement
Bitwise Operators
Operator What It Does
& Bitwise AND
| Bitwise Inclusive OR
^ Exclusive OR
~ Unary complement (bit inversion)
<< Shift Left
>> Shift Right
Other Operators
Operator What It Does
() Cast
, Comma
Sizeof() Size of
? : Conditional
& Address
* Indirection

About This Article

This article is from the book:

About the book author:

Neal Goldstein is a veteran programmer and trusted instructor of iOS programming topics. He is the author of all editions of iPhone Application Development For Dummies. Karl Kowalski is a programmer who specializes in security and mobile apps and author of Mac Application Development For Dummies.

This article can be found in the category: