my project is some kind of a timing application for Mac OS X and I want to cause drawRect in TimeCircle to refresh myView. I´m aware that I asked a similar question before. But my problem is not solved yet and it is different from other topics which are similar.
What I have so far:
An NSObject Class TimeController which starts a timer and modifies some NSTextEdits on a per second base.
An NSView Class TimeCircle which is connected to a custom view which I want to draw a circle with a clock like hand representing the progress.
Imported TimeCircle.h in TimeController.m
An instance method drawRectOutsideWrapper which I send a message when the timer is running. [TimeCircle drawRectOutsideWrapper:(float) seconds]; this works.
drawRectOutsideWrapper is this:
- (void) drawRectOutsideWrapper:(float) seconds {
liveAngle= seconds;
[self->myTimeCircleView setNeedsDisplay:YES];
}
drawRectOutsideWrapper receives the message from TimeController correctly!
The problem is that [self->myTimeCircleView setNeedsDisplay:YES]; doesn´t fire drawRect. It just does nothing. For testing purposes I integrated a slider makeLiveLine which actually does the same thing and drawRect gets triggered correctly:
- (IBAction)makeLiveLine:(id)sender {
liveAngle= [sender intValue];
[self->myTimeCircleView setNeedsDisplay:YES];
}
Any clues why one is doing the job and one doesn't?