Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
到处省略了一些东西,但是插入就足够了。
// .h IBOutlet UISlider *progressSlider; NSTimer *progressTimer; @property (nonatomic, retain) UISlider *progressSlider; @property (nonatomic, retain) NSTimer *progressTimer; - (void)updateSlider; - (void)resetTimer:(NSTimer *)timer; // .m // synthesize variables - (void)handleNowPlayingItemChanged:(id)notification { NSNumber *duration = [item valueForProperty:MPMediaItemPropertyPlaybackDuration]; float totalTime = [duration floatValue]; progressSlider.maximumValue = totalTime; } - (void)updateSlider { [progressSlider setValue:musicPlayer.currentPlaybackTime animated:YES]; } - (void)resetTimer:(NSTimer *)timer { [progressTimer invalidate]; progressTimer = nil; progressTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateSlider) userInfo:nil repeats:YES]; } // init and release methods (together at the bottom with view controls // (like viewDidLoad) for convenience) // // don't forget to register for notifications @end
如果你想要一个示例应用程序(仅限设备;iPod 库),我可以写一个,但不会比这多多少。
Omitted some things here and there, but it's enough to plug in.
If you want a sample app (device only; iPod library), I can write one, but it won't be much more than this.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
到处省略了一些东西,但是插入就足够了。
如果你想要一个示例应用程序(仅限设备;iPod 库),我可以写一个,但不会比这多多少。
Omitted some things here and there, but it's enough to plug in.
If you want a sample app (device only; iPod library), I can write one, but it won't be much more than this.