Bezdepbonusu7Программирование: статьи и ответы

Вопрос

Почему компоновщик жалуется на отсутствие символов?

Автор вопроса: CommunityОтветов: 1

Почему я получаю эту странную ошибку? http://img266.imageshack.us/img266/2203/help.tif Есть идеи?

выполнение:

#import "VideoView.h"
#import <MediaPlayer/MediaPlayer.h>

@implementation VideoView
@synthesize player;

- (void)playVideoWithURL:(NSURL *)url showControls:(BOOL)showControls {
    if (!player) {
        player = [[MPMoviePlayerController alloc] initWithContentURL:url];

        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didFinishPlaying:) name:MPMoviePlayerPlaybackDidFinishNotification object:player];

        if (!showControls) {
            player.scalingMode = MPMovieScalingModeAspectFill;
            player.movieControlMode = MPMovieControlModeHidden;
        }

        [player play];
    }
}

- (IBAction)playVideoWithControls {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"mov"];
    NSURL *url = [NSURL fileURLWithPath:path];
    [self playVideoWithURL:url showControls:YES];
}


- (void)didFinishPlaying:(NSNotification *)notification {
    if (player == [notification object]) {
        [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:player];
        [player release];
        player = nil;
    }
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
}


- (void)dealloc {
    [super dealloc];
}


@end

Заголовок:

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>


@interface VideoView : UIViewController {
    MPMoviePlayerController *player;

}
@property (nonatomic, retain) MPMoviePlayerController *player;
- (IBAction)playVideoWithControls;


@end

iphonecocoalinker

Ответы

Ответ 1 · рейтинг 5 · Nikolai Ruhe

MPMoviePlayerController находится в MediaPlayer.framework, на который вы забыли ссылаться.

Перевод вопроса и ответов сообщества Stack Overflow, лицензия CC BY-SA. Оригинал на Stack Overflow.

Похожие материалы