cirlceColor isn't changing


#1

I am working on the shake function for chapter 6 and I have it set to change the background color and the circle color when it shakes but the background color is the only one that is changing.

[code]
-(id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if(self)
{
[self setBackgroundColor:[UIColor clearColor]];
[self setCircleColor:[UIColor lightGrayColor]];
}
return self;
}

-(BOOL) canBecomeFirstResponder
{
return YES;
}

-(void) setCircleColor:(UIColor *)clr
{
circleColor = clr;
[self setNeedsDisplay];
}

-(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
NSLog(@“Device is waving like it just don’t care”);
[self setBackgroundColor:[UIColor lightGrayColor]];
[self setCircleColor:[UIColor blackColor]];
}[/code]

Can anybody tell me whats wrong with my code?


#2

Are you sure it is not the other way around?

If the background color is not changing, you are probably not telling the view to redraw itself after setting the color.


#3

The background color is changing however the circles are not.