[self setValue:flag forKey:variableName];
“flag” is a method’s local BOOL; the keypath is also a BOOL member variable. But I get the Xcode warning `Incompatible integer to pointer conversion.”
I also tried:
[self setValue:(BOOL)flag forKey:variableName];
How do I get rid of this warning?
KVC automatically boxes and unboxes non-objects. For the above case, you would use:
See Scalar and Structure Support in the Key-Value Coding Programming Guide.