Hope someone can help with this. When I try to use the -timeIntervalSinceNow method -timeIntervalSinceNow I get bad access. I have a variable in this class called NSDate *startDate , and I added @property (nonatomic, retain) NSDate *startDate;
startDate used here:
startDate = [NSDate date]; updateTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(updatePlaybackPosition:) userInfo:nil repeats:YES]; }
}
- (void)updatePlaybackPosition:(NSTimer *)timer { NSTimeInterval interval = [startDate timeIntervalSinceNow];
When the program reaches [startDate timeIntervalSinceNow] , it gives a bad access error. Of the other posts I read on this topic, usually the answer is usually related to saving the date. So I'm not sure what I am missing. Any help is appreciated!
source share