-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for all primitive types via NSValue #201
Comments
What’s the reason behind this intended change? |
KVC can't handle NSValue with non-nsvalue structs, pointers, c-strings, unions, selectors etc. I.e. KVC can't handle NSValue created by |
Ok. Understood. |
…ions, static allocated c-arrays) (#201)
Seems, like all works great. Now we can inject all primitive types in typhoon! #define NSValueFromPrimitive(primitive) ([NSValue value:&primitive withObjCType:@encode(typeof(primitive))]) Macros usage example: //char *
char *string = "Hello world";
[definition injectProperty:@selector(cString) with:NSValueFromPrimitive(string)];
//Selector
[initializer injectParameterWith:NSValueFromPrimitive(@selector(selectorValue))];
//Structure
PrimitiveManStruct structure;
structure.fieldA = 23;
structure.fieldB = LONG_MAX;
[initializer injectParameterWith:NSValueFromPrimitive(structure)]; |
…rty injection for all cases except unwrapping NSValue/NSNumber
Leaving this open so that I remember to update the documentation in the Typhoon 2.0 release. |
I mean adding support for all structures and types, using method
value:withObjCType
of NSValue.For example:
Plan to implement:
setter
andgetter
method names from runtime for properties (not just set)The text was updated successfully, but these errors were encountered: