Using Objective-C Operators in iOS 6 App Development

Part of the iOS 6 Application Development For Dummies Cheat Sheet

Objective-C has many helpful operators for your iOS programming. Use the following table to jog your memory about which operator you should use to accomplish a certain 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
++ Addition
-- Subtraction
*= Multiplication
/= Division
%= Modulo
&= Bitwise AND
|= Bitwise Inclusive OR
^= Exclusive OR
<<= Shift Left
>>= Shift Right
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
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus

SERIES
iOS 6 Application Development For Dummies Cheat Sheet

Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win $500. Easy.