Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What will be the value of a BOOL property that I don't set? [duplicate]

Possible Duplicate:
default value of BOOL in Objective-C?

If I declare a BOOL property in a class, what will be its default value? If I don't set a value for the variable when creating an object of the class, is it always NO or will it return YES in any case?

like image 250
Arock Avatar asked Jan 08 '13 06:01

Arock


1 Answers

It'll be NO. It'll be initialized to FALSE/NO, Because when you declare it without any value, it'll be initialized to zero, zero means FALSE or NO

like image 52
Midhun MP Avatar answered Nov 13 '22 02:11

Midhun MP