User defaults acts like other container classes: they take objects as elements not scalar types. So you need to wrap that scalar type (BOOL) with an NSNumber
:
[settings setObject:[NSNumber numberWithBool:NO] forKey:@"signout"];
// with modern syntax
[settings setObject:@(NO) forKey:@"signout"];
But it sounds like you're getting the value from a switch, so you won't be able to use the new literal syntax, that is:
[settings setObject:[NSNumber numberWithBool:self.mySwitch.on] forKey:@"signout"];
Remember, when reading back from defaults, you'll need to unwrap the wrapped scaler, like this:
self.mySwitch.on = [[settings objectForKey:@"signout"] boolValue];