MPMoviePlayerController 设置未知文本
MPMoviePlayerController set unknown text
我用MPMoviePlayerController
播放视频。它有效,但它显示未知字符串,我认为它与其本地化文件有关:
播放视频的代码在这里:
NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"m4v"];
NSURL *streamURL = [NSURL fileURLWithPath:videoPath];
MPMoviePlayerController *moviplayer =[[MPMoviePlayerController alloc] initWithContentURL: streamURL];
[moviplayer prepareToPlay];
[moviplayer.view setFrame: self.view.bounds];
[self.view addSubview: moviplayer.view];
moviplayer.fullscreen = YES;
moviplayer.shouldAutoplay = YES;
moviplayer.repeatMode = MPMovieRepeatModeNone;
moviplayer.movieSourceType = MPMovieSourceTypeFile;
[moviplayer play];
如何解决这个问题?
查看我项目的所有部分后,我发现下面用于设置应用程序默认语言的 class(类别)产生了这个错误:
https://github.com/cmaftuleac/BundleLocalization
使用这个分支 class 通过不使用 UIKit 捆绑包的 swizzling 方法解决了我的问题:
https://github.com/jbolter/BundleLocalization
https://github.com/jbolter/BundleLocalization/commit/4eedcf45a315a4a5f3ddaf9521f3cadec6632bcc
我用MPMoviePlayerController
播放视频。它有效,但它显示未知字符串,我认为它与其本地化文件有关:
播放视频的代码在这里:
NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"m4v"];
NSURL *streamURL = [NSURL fileURLWithPath:videoPath];
MPMoviePlayerController *moviplayer =[[MPMoviePlayerController alloc] initWithContentURL: streamURL];
[moviplayer prepareToPlay];
[moviplayer.view setFrame: self.view.bounds];
[self.view addSubview: moviplayer.view];
moviplayer.fullscreen = YES;
moviplayer.shouldAutoplay = YES;
moviplayer.repeatMode = MPMovieRepeatModeNone;
moviplayer.movieSourceType = MPMovieSourceTypeFile;
[moviplayer play];
如何解决这个问题?
查看我项目的所有部分后,我发现下面用于设置应用程序默认语言的 class(类别)产生了这个错误:
https://github.com/cmaftuleac/BundleLocalization
使用这个分支 class 通过不使用 UIKit 捆绑包的 swizzling 方法解决了我的问题: https://github.com/jbolter/BundleLocalization https://github.com/jbolter/BundleLocalization/commit/4eedcf45a315a4a5f3ddaf9521f3cadec6632bcc