Re:Objective-C Bitmask Enumeration Essentials
by MaxGabriel on Friday May 23, 2014 @12:11PM
(#7789945)
Is this the correct approach?
[ Parent
| on HN ]
Re:Objective-C Bitmask Enumeration Essentials
by plorkyeran on Friday May 23, 2014 @12:27PM
(#7790013)
(mask & NSEventMaskEndGesture) == NSEventMaskEndGesture is the most correct, as it handles the case where NSEventMaskEndGesture has multiple bits set.
Re:Objective-C Bitmask Enumeration Essentials
by ridiculous_fish on Friday May 23, 2014 @01:56PM
(#7790453)
I think, not!!
BOOL end = !! (mask & NSEventMaskEndGesture);
Like a little pair of surprised eyes.Also works for pointers:
BOOL hasError = !! errorObj;