I have a superclass O with a property UIView *view.
@interface O : NSObject
{
UIView *view;
}
@property (nonatomic, weak) UIView *view;
@end
UIView sublass:
@interface myView : UIView
@property (nonatomic, weak) UIColor color;
I then have a sublass of O which has the following in its init:
view = [[myView alloc] init];
view.color = [UIColor redColor];
color is a property of myView used in some custom drawing code.
This causes the compiler to crash because UIView does not have a property color. I would be able to set the value using the setColor method, but it would be nice to be able to access the property via dot syntax.
Is there a way to do this?
edited:
in your specific case you need to declare
viewasmyView *viewinstead ofUIViewin your .h file. then you will have access of custom color property.