iosobjective-cobjective-c-runtimetyphoon

TyphoonAssembly not assembling Objects provided as @Property


I would like to define all the objects that my assembly can assemble through properties instead of public methods(Reason below). The problem I see is that when i call [XYZAssembly getXYZProperty] my assemblies can't assemble those objects. Instead of an instance of XYZProperty I am getting TyphoonDefinition: class='XYZPropertyClass', key='(null)', scope='Unknown

For example in my Header file:

@property (nonatomic, strong, getter=getXYZProperty) XYZPropertyClass *XYZProperty

And in my implementation file:

-(XYZPropertyClass *)getXYZProperty {
     return [TyphoonDefinition withClass:[XYZPropertyClass class]];
}

Why am I going this route instead of creating the public methods without @Properties? My goal here is to use OBJC Runtime so I can retrieve the Class of a property, the conforming specific protocol that I am looking for, its name, its accessor selector, etc... Having all this information I can basically say, [XYZAssembly performSelector(@selector(whatever the property's selector is)]. OBJC Runtime does not provide me any type of information regarding the return type(only if its an Object), so without that I can't know if it conforms to a specific protocol.

Is there any reason I can't do that? It is a known bug? It is done like that intentionally?


Solution

  • I think I have found what is causing the issue. When the assembly is getting instantiated, all the properties from the assembly are being treated as Assemblies also. I am assuming that Assemblies should only have properties if their properties are other Assemblies. Are there any reasons why Typhoon would not allow to have Assemblies with other properties other than Assemblies? If there aren't, should I file a bug asking to check if the property is subclass of TyphoonAssembly?

    I made the change in my own workspace and now I can call all the getter for my property without any problem and its not identifying my property as an assembly anymore, it is just an XYZPropertyClass :)