Comment Comment by sandoze In Objective-C we can create methods, properties and classes on the fly using <objc/runtime.h>Here's how to create a property on the fly (great for categories)@dynamic progressView;- (void)setProgressView:(ACProgressView )progressView { objc_setAssociatedObject(self, ACProgressViewKey, progressView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }- (ACProgressView )progressView { return objc_getAssociatedObject(self, ACProgressViewKey); } parent sandoze 13 years ago
Here's how to create a property on the fly (great for categories)
@dynamic progressView;
- (void)setProgressView:(ACProgressView )progressView { objc_setAssociatedObject(self, ACProgressViewKey, progressView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); }
- (ACProgressView )progressView { return objc_getAssociatedObject(self, ACProgressViewKey); }