cirlceColor isn't changing


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.

self = [super initWithFrame:frame];
[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]];

Can anybody tell me whats wrong with my code?


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.


The background color is changing however the circles are not.