I have:
BOOL someBoolValue = ... //some code returning BOOL
when I try to invoke:
[self performSelectorOnMainThread:@selector(refreshView:) withObject:someBoolValue waitUntilDone:NO];
I’m getting a warning:
cast to pointer from integer of different size
Any hints on this?
You are passing a “raw” boolean value, where an
id(pointer to an object) should be.should better be
You can extract the boolean value in your
refreshView:method by sending theboolValuemethod to the number object:Unlike Java or C#, Objective-C has no “autoboxing” from primitive values to objects. The
BOOLtype is just a small integer type, which causes the error message you are seeing, because the compiler needs a pointer for the second argument toperformSelectorOnMainThread:withObject:waitUntilDone:.