I have the following function:
+ (int)isCorrectOnServer:(int)num {
// some code performs here...
if (this)
{
result = 2;
}
else if (this2)
{
result = 1;
}
else
{
result = 0;
}
return result; }
I want it to return like this instead:
+ (int)isCorrectOnServer:(int)num {
// some code performs here...
if (this)
{
result = kOnServer;
}
else if (this2)
{
result = kWrongType;
}
else
{
result = kNotOnServer;
}
return result; }
So anywhere in my code I could just call:
if ([Helper isCorrectOnServer:276872] == kOnServer)
to make my code cleaner and not show 0, 1, or 2 as the result. What is the best way to go about doing this?