I’m trying to make a method with a similar format to the setAutoresizingMask: method of NSView. I want to have someone be able to specify multiple values that i declared in my enum (NSHeightSizable | NSWidthSizable) like in autoresizing mask. How can I do this?
I’m trying to make a method with a similar format to the setAutoresizingMask: method
Share
First, declare your flags in a header:
The
(1 << 0)through to(1 << 3)represent single bits in an integer that you can “mask” in and out of an integer. For example, assumingNSUIntegeris 32-bits, and someone has chosen both apple and durian, then the integer would look like this:Typically your method needs to take an unsigned integer argument: