我有一个需求,需要使用MPMediaPlayerController
播放视频。除了视频外,我还有两个按钮,当这些按钮被点击时,我需要捕获当前的播放时间,并将所有相关的点击分别存储。我能够使用“currentPlaybackTime”属性获取视频的当前播放时间,该属性返回NSTimeInterval
。但是,有人能帮我解决如何将所有的NSTimeInterval
值存储到NSMutableDictionary
中吗?我已经尝试过以下方法:
-(void)onClickOfGood {
NSLog(@"The current playback time in good:%g",moviePlayerController.currentPlaybackTime);
currentPlaybackTime = moviePlayerController.currentPlaybackTime;
//NSArray *arrayContainsGoodClicks = [[NSArray alloc]initWithObjects:currentPlaybackTime, nil ];
NSNumber *goodTimeIntervals = [NSNumber numberWithDouble:currentPlaybackTime];
NSMutableArray *arrayContainsGoodClicks = [[NSMutableArray alloc]initWithObjects:goodTimeIntervals,nil ];
NSLog(@"The total count of Array is: %i",[arrayContainsGoodClicks count]);}
但是每次点击好按钮之后,我的数组计数只有1。有人可以请指点一下我哪里出了错吗?