See the code here
@interface StaticView : UIView {
Properties *prop;
}
@property (retain) Properties *prop;
@end
and i am attaching this view via code
[super viewDidLoad];
StaticView *sView = [[StaticView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
sView.prop.glowIntensity = 0.85f;
[self.view addSubview:sView];
but in my drawRect Method of StaticView i am always getting prop.glowIntensity = 0.0000
- (void)drawRect:(CGRect)rect {
NSLog(@"%f", prop.glowIntensity);
}
Here is my Properties.h
@interface Properties : NSObject {
UIColor *bgColor;
UIColor *foreColor;
float glowIntensity;
}
@property(retain) UIColor *bgColor;
@property(retain) UIColor *foreColor;
@property float glowIntensity;
-(void) initbgColor:(UIColor *)bgC foreColor:(UIColor *)fC glowIntensity:(float) gI;
@end
here is implementation Properties.m
#import "Properties.h"
@implementation Properties
@synthesize bgColor;
@synthesize foreColor;
@synthesize glowIntensity;
-(void) initbgColor:(UIColor *)bgC foreColor:(UIColor *)fC glowIntensity:(float) gI
{
self.bgColor = bgC;
self.foreColor = fC;
self.glowIntensity = gI;
}
@end
How can i pass right value to my StaticView class?