I am dealing with an old iPhone OS 2.x project and I want to keep compatibility, while designing for 3.x.
I am using NSInvocation, is a code like this
NSInvocation* invoc = [NSInvocation invocationWithMethodSignature:
[cell methodSignatureForSelector:
@selector(initWithStyle:reuseIdentifier:)]];
[invoc setTarget:cell];
[invoc setSelector:@selector(initWithStyle:reuseIdentifier:)];
int arg2 = UITableViewCellStyleDefault; //????
[invoc setArgument:&arg2 atIndex:2];
[invoc setArgument:&identificadorNormal atIndex:3];
[invoc invoke];
to have a code in a way that both 3.0 and 2.0 like, each one using its proper syntax.
I am having a problem on the line I marked with question marks.
The problem there is that I am trying to assign to arg2, a constant that has not been defined in OS 2.0. As everything with NSInvocation is to do stuff indirectly to avoid compiler errors, how do I set this constant to a variable in an indirect way? Some sort of performSelector "assign value to variable"...
is that possible? thanks for any help.