我已经完成了以下操作 - 曾经播放过 QTMovie(在 Mountain Lion 上)并希望在电影结束时收到通知。但通知从未被调用!谁能告诉我我做错了什么?
- (void)playMovie:(QTMovie *)movie {
[self.movieView.movie stop];
if (movie) {
self.movieView.movie = movie;
[movie gotoBeginning];
[movie play];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(stopMovie:) name:QTMovieDidEndNotification object:self];
}
}
- (void)stopMovie:(NSNotification *)notification {
NSLog(@"stop movie!");
[[NSNotificationCenter defaultCenter] removeObserver:self name:QTMovieDidEndNotification object:nil];
}