问题描述
我已经对此进行了搜索,发现有很多争论,我了解到这个问题与Spritekit的OpenGl的渲染有关.有些人在与Spritekit一起玩AUdio时遇到了这个问题.
I have googled this, and I found many debates over this, what i understand is this problem is related to rendering of OpenGl of Spritekit, Some people were facing this problem when they were playing AUdio with Spritekit.
虽然我的情况有所不同,但是当我使用函数对Flurry Publisher Api进行整数化时,我面临着这个问题
While My case is different i am facing this when i integerate Flurry publisher Api using the Function
在[Flurry startSession:FlurryAPPKey];
在APPDelegete文件中
in APPDelegete File
注释以上代码可解决此问题.
Commenting out the above code removed the problem.
我认为有几件事,当您使用SpriteKit进行整数运算时,就像我在Google上发现的那样,这会发生,例如AVAudioSession等,
I think there are a couple of things that when you integerate with SpriteKit this Happens as i found on google, like AVAudioSession, etc,
我只是想知道,避免这种渲染问题的最佳实践是什么,否则Flurry Sdk 4.4.2可能确实会发生这种情况?不知道,但回溯显示
I just wanted to know, what is the best practice to avoid such rendering problem, or this may really be happening with Flurry Sdk 4.4.2? don't know but the backtrace is showing
#0 0x3311b932 in gpus_ReturnNotPermittedKillClient ()
#24 0x31032844 in UIApplicationMain ()
#25 0x0004cd16 in main at ....
这是示例代码的链接 Flurry SpriteKit
here is the link of sample codeFlurry SpriteKit
推荐答案
您应该始终在后台暂停SKView.这样可以防止SpriteKit生成gpus_ReturnNotPermittedKillClient
异常.似乎某些执行后台工作的服务(例如Flurry& amp; AVAudioSession,以这种方式干扰SpriteKit.因此,为防止这种情况,您可以执行以下操作.
You should always pause your SKView upon backgrounding. This will prevent SpriteKit from generating the gpus_ReturnNotPermittedKillClient
exception. It seems that some services which perform background work, such as Flurry & AVAudioSession, interfere with SpriteKit in this way. So to prevent this you can do the following.
// Register for relevant application lifecycle notifications
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillResignActive)
name:UIApplicationWillResignActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationDidBecomeActive)
name:UIApplicationDidBecomeActiveNotification
object:nil];
// Pause/Unpause SKView instance
- (void)applicationWillResignActive
{
[[self skView] setPaused:YES];
}
- (void)applicationDidBecomeActive
{
[[self skView] setPaused:NO];
}
这篇关于SpriteKit在使用[Flurry startSession:FlurryAPPKey]进入背景时崩溃;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!