Reputation: 10245
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 *')
Upvotes: 7
Views: 10135
Reputation: 299703
You've made a pointer to a BOOL
, which is a primitive type. Remove the extra *
in front of remoteActivityIndicator
.
Upvotes: 3
Reputation: 137442
removeActivityIndicator
is a char pointer, and you assigns a char to it, so either:
BOOL removeActivityIndicator;
*(self.removeActivityIndicator) = YES;
Upvotes: 4
Reputation:
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.
Upvotes: 31