启动应用程序时出错:
malloc: *** mmap(size=2147483648) failed (error code=12)]n
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
我怀疑这是由于初始化不当造成的,但我不太确定。
- (void)loadSoundWithUrl:(NSURL *)url isLocal:(BOOL)isLocal
{
if (!url)
return;
self.player = [[AVPlayer alloc] initWithURL:url];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self.playBackTimer invalidate];
self.playBackTimer = [NSTimer scheduledTimerWithTimeInterval:0.9
target:self
selector:@selector(playBackTimerMethod:)
userInfo:self
repeats:YES];
if (self.isPlay)
[self playCommand];
}
这是我的功能,初始化哪个Avplayer,你能帮助我,因为我不知道在特定情况下该做什么。