Objective-C 中 BOOL 类型的属性未初始化,那么它的值是默认YES/NO,还是随机的?
怪我咯2017-04-28 09:08:24
The default value of basic data types in OC is 0, and the type 0 of BOOL represents NO
PHP中文网2017-04-28 09:08:24
The BOOL type is a typedefed char type. When not initialized, it is the same as the C language, which is 0 in ASCII, and the same as 0000 in Unicode
仅有的幸福2017-04-28 09:08:24
Member variables have default values:
Variables | Default value |
---|---|
Byte | 0 |
short | 0 |
int | 0 |
long | 0L |
char | /u0000' |
float | 0.0F |
double | 0.0D |
Boolean | FALSE |
All pointer variables | nil (is the null pointer) |