I am not sure if this is what you are looking for, but you can add a flag using the "bitwise or" operator:
unitFlags |= NSYearCalendarUnit;
and remove a flag using "bitwise and" in combination with "bitwise complement";
unitFlags &= ~NSYearCalendarUnit;
To check for a flag:
if ((unitFlags & NSYearCalendarUnit) != 0) {
// NSYearCalendarUnit is set
} else {
// NSYearCalendarUnit is not set
}