Ios – warning when using BOOL variable in objective-c

booleaniosiphoneobjective c

I am trying to initalize my BOOL variable to YES but its giving me this warning.. not quite sure what to do.. it still seems to be working fine but just wondering how I can get rid of the warning.

I have initalize the variable in the header like this

//.h

BOOL *removeActivityIndicator;
//..
@property (nonatomic, assign) BOOL *removeActivityIndicator;

Then I try to set it to YES like so (this is also where I get the warning)

self.removeActivityIndicator = YES;

The warning says :

incompatible integer to pointer conversion passing 'BOOL' (aka
'signed char') to paramater of type 'BOOL *' (aka 'signed char *')

Best Answer

The warning is correct; you've declared the variable as a BOOL * (a pointer to a BOOL), which is almost certainly not what you want. Remove the * from the declaration.