I need to test if a property is empty or not. It’s declared like this in my header file:
@property (nonatomic) char nextOperation;
And in the .m file:
@synthesize nextOperation;
Correct me if I’m doing anything wrong, I’m pretty new in this world.
In a method I have to test if nextOperation has anything on it. If true (YES?) I should do something, and after that assign a new value to that property.
I’ve tried nextOperation == '', empty, isEmpty, isempty, and everything throws me an Xcode warning/error.
A char can not be empty. A char is a scalar value just like an int – just a little smaller (usually 8 bit). You might want to compare it to
0or0x00for your purpose.e.g.