jspahrsummers/libextobjc — pull request #48 by woolsweater (2013-10-28 09:11:20+00:00)
Title: Added @passthrough_property macro to resolve Issue #5 "EXTPassthrough breaks with implicit property synthesis"

The new macro allows forwarding of a specified property to a property on another class. This commit includes tests for the new macro, and a doc string.

This necessitated some small changes to the existing passthrough_ macro; in particular, a SEL_GETTER must be passed in — this is @selector when the method name is specified literally, but sel_getUid for properties. A property’s accessor methods must be looked up at runtime. The lookup is implemented by two helper functions, which are in EXTPassthrough.m I considered macro-generated functions to cache the accessor names, but it seemed more trouble than it was worth.

This commit is intended to resolve #5. It does so by inserting an @dynamic directive for the named property. This comes with the hitch that both the @property declaration and the @passthrough_property must be in the same "segment" of the class -- either the same category, or in the main @interface/@implementation blocks.