Probably the error is silly, but I can't make this work.
I've subclassed an UIView and added two fields: 1 CGPoint and 1 CGFloat. I know this is not all MVC compliant, but I just don't want to create a model object for this.
The problem is that when I want to use them in drawRect:, both are null.
No errors or messages in the console.
Thanks!
I've subclassed an UIView and added two fields: 1 CGPoint and 1 CGFloat. I know this is not all MVC compliant, but I just don't want to create a model object for this.
The problem is that when I want to use them in drawRect:, both are null.
No errors or messages in the console.
Code:
@interface DotView : UIView {
CGPoint center;
CGFloat radius;
}
@end
@implementation DotView
- (id)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
center = CGPointMake(50.0, 50.0);
radius = 10.0;
}
return self;
}
@end
Thanks!