You can use the #if, #elif, and #else directives for this. Please see following sample code.
#define XVALUE 5
#define YVALUE 7
#if defined(XVALUE) && XVALUE == 5
#if defined(YVALUE) && YVALUE == 7
#define someString @"Test1"
#else
#define someString @"Test2"
#endif
#else
#define someString @"Test3"
#endif
You might want to make function which can replace some inline code resulting in a string value, as following:
#ifdef __OBJC__
static inline NSString* SomeStringInline(int xValue, int yValue)
{
if(xValue == 5)
{
if (yValue == 7) {
return @"Test1";
}
else
{
return @"Test2";
}
}
else
{
return @"Test3";
}
}
#endif
And you invoke this method from like
NSLog(@"%@", SomeStringInline(5, 7));
And output will be "Test1".
Use whatever suites you.
For more help on macros: