This repository was archived by the owner on Dec 5, 2019. It is now read-only.
Added @passthrough_property macro to resolve Issue #5 "EXTPassthrough breaks with implicit property synthesis" #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 internal
passthrough_macro; in particular, aSEL_GETTERmust be passed in — this is@selector()when the method name is specified literally, butsel_getUid()for properties, because the property’s accessor method names must be looked up at runtime. The lookup is implemented by two helper functions, which are in EXTRuntimeExtensions. 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
@dynamicdirective for the named property. This comes with the hitch that both the@propertydeclaration and the@passthrough_propertymust be in the same "segment" of the class definition -- either the same category, or in the main@interface/@implementationblocks.