The fact is that these are flags intended to be used as a bitmask, which leads to problems with enumerations. For example, if it looks like this:
typedef enum { UIViewAutoresizingNone = 0, UIViewAutoresizingFlexibleLeftMargin = 1 << 0, UIViewAutoresizingFlexibleWidth = 1 << 1, UIViewAutoresizingFlexibleRightMargin = 1 << 2, UIViewAutoresizingFlexibleTopMargin = 1 << 3, UIViewAutoresizingFlexibleHeight = 1 << 4, UIViewAutoresizingFlexibleBottomMargin = 1 << 5 } UIViewAutoresizing;
And you would call setAutoresizingMask: in the view using UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight , the compiler will complain, and you must explicitly cast it back to the UIViewAutoresizing type. However, NSUInteger can accept a bitmask.
Also, all that lef2 says about NSUInteger not as an ObjC object.
source share