Bit Operators

Various operators in the Objective-C language work with the particular bits used to represent an integer value. Table 10.1 presents these operators.

Image

Table 10.1 Bit Operators

Note

You won’t use bitwise operators much, if at all, in your Objective-C programs, although you will come across them in framework header files. Because this material may be a little dense for new programmers, you can just skim this section and refer back to it later, if necessary.

All the operators listed in Table 10.1, with the exception of the ones that complement operator (~), are binary operators and, as such, take two operands. Bit operations can ...

Get Programming in Objective-C, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.