2012-06-27 41 views
0

我從本地項目resource.i上播放mpmovieplayercontroller上的視頻,我正在啓動顯示一些錯誤的應用程序控制臺,以及如何在mpmovieplayercontroller或mpmovieplayercontroller中修復和播放適當的方式。下面顯示了我在控制檯輸出,但應用程序得到的錯誤不會崩潰:在ios5中使用MPMoviePlayer控制器播放視頻

Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable 
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security 
    Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-06-27 18:08:49.171 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable 
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security 
    Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-06-27 18:08:49.229 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable 
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security 
    Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-06-27 18:08:49.237 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable 
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security 
    Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-06-27 18:08:49.252 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable 
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security 
    Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 
2012-06-27 18:08:49.260 Chellame Chellam[3088:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable 
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security 
    Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 
in /System/Library/Frameworks/Security.framework/Versions/A/Security 

這裏是我的代碼用於播放視頻:

#import "VideoPlayerControllerViewController.h" 

@interface VideoPlayerControllerViewController() 

@end 

@implementation VideoPlayerControllerViewController 
@synthesize moviePlayer; 

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    [self playMovie]; 
    // Do any additional setup after loading the view, typically from a nib. 

} 

- (void)viewDidUnload 
{ 
    [super viewDidUnload]; 
    // Release any retained subviews of the main view. 
} 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 
} 
-(void)moviePlayBackDidFinish:(NSNotification*)aNotification{ 
    NSLog(@"Play Back Finished!"); 
    [moviePlayer play]; 
} 
-(void)playMovie 
{ 
    NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] 
             pathForResource:@"Menu_Free" ofType:@"mp4"]]; 
    moviePlayer = [[MPMoviePlayerController alloc] 
        initWithContentURL:url]; 

    [[NSNotificationCenter defaultCenter] addObserver:self 
              selector:@selector(moviePlayBackDidFinish:) 
               name:MPMoviePlayerPlaybackDidFinishNotification 
               object:moviePlayer]; 

    moviePlayer.controlStyle = MPMovieControlStyleDefault; 
    moviePlayer.shouldAutoplay = YES; 
    moviePlayer.view.frame = self.view.bounds; 
    moviePlayer.scalingMode= MPMovieScalingModeFill; 
    moviePlayer.controlStyle =MPMovieControlStyleNone; 
    [self.view addSubview:moviePlayer.view]; 
    [moviePlayer setFullscreen:YES animated:YES]; 
} 

@end 

先謝謝了!

+0

的可能重複[這是什麼gdb的輸出意思?(http://stackoverflow.com/questions/7961840/what-does-this-gdb-output-mean)發生 – Till

回答

1

替換你的方法與此...

-(void)playMovie 
{ 
    NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] 
             pathForResource:@"Menu_Free.mp4" ofType:@""]]; 
    moviePlayer = [[MPMoviePlayerController alloc] 
        initWithContentURL:url]; 

    [[NSNotificationCenter defaultCenter] addObserver:self 
              selector:@selector(moviePlayBackDidFinish:) 
               name:MPMoviePlayerPlaybackDidFinishNotification 
               object:moviePlayer]; 

    moviePlayer.controlStyle = MPMovieControlStyleDefault; 
    moviePlayer.shouldAutoplay = YES; 
    moviePlayer.view.frame = self.view.bounds; 
    moviePlayer.scalingMode= MPMovieScalingModeFill; 
    moviePlayer.controlStyle =MPMovieControlStyleNone; 
    [self.view addSubview:moviePlayer.view]; 
    [moviePlayer setFullscreen:YES animated:YES]; 
} 

當你添加的文件夾資源沒有你的項目請確保您選擇波紋管選項。

enter image description here

+0

同樣的錯誤我我正在使用ios5.1 sdk和Xcode 4.2.3! – Dinesh

+0

創建一個名爲「Resources」的目錄,並將您的視頻文件放在這個目錄中,然後運行代碼... – Deepak

+0

嘗試相同的錯誤Deepak! – Dinesh

相關問題