More specifically, the string returned by property_getAttributes( ) is something like:
T@"Foo",N,D,&
when it should be
T@"MyApp.Foo",N,D,&
This breaks code of mine that looks up the property's class based on the class name parsed from the above — when it calls objc_getClass("Foo") it gets NULL.
I'm working around this by looking at the name of the class that contains the property, checking if it includes a module (a prefix delimited by "."), and if so prepending that module name to the property's class; if this fails then I fall back to looking up the class in the global namespace.
This works, but it's kind of a kludge. It can do the wrong thing if a module contains a class with the same base name as one in the global namespace, and it'll also fail if a class in one module has a property whose type is a class from a different module. However, I can't see a proper fix for this since the module information does not seem to be available through the runtime API.
Is there a way to get the full class name, or should I file a Radar?
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list (Objc-language@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/anirudha.k.cpp1%40blogger.com
This email sent to anirudha.k.cpp1@blogger.com
No comments:
Post a Comment