I declared a function with boolean input var. I get no errors. However, when calling it from another controller, notification appears: “incompatible integer to pointer conversion sending’BOOL’ to parameter of type BOOL”. What am I doing wrong? Thanks.
- (void)composeBar: (BOOL *)savePars
from other view:
AppDelegate *localFunction = [[UIApplication sharedApplication] delegate];
[localFunction composeBar:YES];
BOOL*isn’t a boolean. It’s a pointer to a boolean. Just useYou’re likely confused because all Obj-C objects are declared with the
*, but that’s because they’re actually pointers. However,BOOLis not an object, it’s actually just acharwhich holds0or1. Just as you would useintfor an integer instead ofint*(or in more idiomatic code,NSInteger), you useBOOLinstead ofBOOL*.