mercredi 29 avril 2015

How to get an "extern const int" value by its name

I would like to get the int value of my extern const by its name.

For example in my .h file:

extern const int MY_INT_CONST;

In my .m file:

const int MY_INT_CONST = 0;

What I want:

- (void) method {
    int i = [getMyConstantFromString:@"MY_INT_CONST"];
}

How can I do that?

I searched in RunTime api and I did not find anything.





Aucun commentaire:

Enregistrer un commentaire