How to make a macro which gives back a string into the source code?

Posted by mystify on Stack Overflow See other posts from Stack Overflow or by mystify
Published on 2010-05-24T11:26:18Z Indexed on 2010/05/24 11:31 UTC
Read the original article Hit count: 209

Filed under:
|
|

Example: I want to do this:

METHODNAME(5) {
    // do something 
}

which results in:

- (void)animationStep5 {
    // do something 
}

Is there any way to do this? Basically, what I need is a way to generate a real source code string before the program is compiled, so the compiler does see - (void)animationStep5...

Or maybe there's something different than a macro, which can help here to auto-generate method names (not at run-time)?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c