1如何将布尔值转为OC对象?
1把 BOOL 值包装到 NSNumber中:
NSNumber *boolNumber = [NSNumber numberWithBool:YES]
2获取BOOL值:
BOOL b = [boolNumber boolValue];
时间: 2024-11-03 22:16:32
1如何将布尔值转为OC对象?
1把 BOOL 值包装到 NSNumber中:
NSNumber *boolNumber = [NSNumber numberWithBool:YES]
2获取BOOL值:
BOOL b = [boolNumber boolValue];