I am writing a wrapper class that uses the dynamic runtime to forward messages to the wrapped object, using forwardInvocation:
However the type checker now complains that the methods aren't implemented on my wrapper class, which is generally a good thing.
So I thought I'd write some method declarations in the header of my wrapper to satisfy the type checker. Note that I just want the declarations, not the definitions.
However, when I copy over my @property
directives, they are not just declared, but defined as well, and in this way they take precedence over the method forwarding, and so it breaks the forwarding.
So is there a way to declare a @property
and not have it automatically synthesize getters and setters? I love this feature so I'd want to disable on a per class basis only, and leave it on for the rest of the project. A bit like -fno-objc-arc
.
P.S. clang -v
=> $ Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
If you add
@dynamic yourProperty;
to the class implementation then no instance variables and no accessor functions will be synthesized for that property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With