mercredi 21 janvier 2015

In objective-c how do I use object_setIvar to set a primitive value?

I have this:



Ivar ivar = class_getInstanceVariable([self class], [name UTF8String]);
CGFloat floatVal = [coder decodeFloatForKey:name];


I'd then like to do this:



object_setIvar(self, ivar, floatVal);


...but I can't just use floatVal like this - what is the syntax for using floatVal in this context?






Aucun commentaire:

Enregistrer un commentaire