大佬教程收集整理的这篇文章主要介绍了ios – 什么是Sprite Kit中的SKSpinLockSync以及如何解决它,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
0 libsystem_platform.dylib OSSpinLockLock + 1 1 SpriteKit SKSpinLockSync(int*,void ()() block_pointer) + 92 2 SpriteKit -[SKTexture loadImageData] + 300 3 SpriteKit -[SKTexture size] + 42 4 SpriteKit SKCEmitterSprite::update(doublE) + 3136 5 SpriteKit SKCSprite::update(doublE) + 354 6 SpriteKit SKCSprite::update(doublE) + 354 7 SpriteKit -[SKScene _update:] + 174 8 SpriteKit -[SKView(PrivatE) _update:] + 324 9 SpriteKit -[SKView renderCallBACk:] + 820 10 SpriteKit __29-[SKView setUpRenderCallBACk]_block_invoke + 130 11 SpriteKit -[SKDisplayLink _callBACkForNextFrame:] + 254 12 QuartzCore CA::Display::DisplayLinkItem::dispatch() + 98 13 QuartzCore CA::Display::DisplayLink::dispatch_items(unsigned long long,unsigned long long,unsigned long long) + 344 14 IOMobileFramebuffer IOMobileFramebufferVsyncNotifyFunc + 104 15 IOKit IODispatchCalloutFromCFmessage + 248 16 ... CoreFoundation __CFMachPortPerform + 136 17 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_sourcE1_PERFORM_FUNCTION__ + 34 18 CoreFoundation __CFRunLoopDosource1 + 346 19 CoreFoundation __CFRunLoopRun + 1406 20 CoreFoundation CFRunLoopRunSpecific + 524 21 CoreFoundation CFRunLoopRunInMode + 106 22 Graphicsservices GSEventRunModal + 138 23 UIKit UIApplicationMain + 1136 24 myApplication main.m line 16 main
编辑:我现在意识到我在几种不同的情况下得到SKSpinLockSync问题,并不总是与发射器有关.我认为,我经常使用发射器看到它的唯一原因是因为这是应用程序中图像加载的狮子份额所以它只是统计上最可能的.堆栈跟踪的前四行始终相同.所以,包括[SKTexture Size].
NSString *p = [[NSBundle mainBundle] pathForresource:name ofType:@"sks"]; SKEmitterNode *e = [NSKeyedUnarchiver unarchiveObjectWithFile:p];
SKSpinLockSync(int*,void ()() block_pointer) + 36 -[SKTexture loadImageData] + 252 -[SKTexture size] + 44 SKCEmitterSprite::update(doublE) + 2928
我认为这是Sprite Kit的问题,希望Apple能尽快解决这个问题
我的解决方案是:不要每次都调用unarchiveObjectWithFile
unarchiveObjectWithFile可能与IO有关,如果您经常像游戏中的每一帧那样执行此操作,或者来自SKTexture缓存系统的问题在需要纹理数据并在非线程安全中调用loadImageData时出现问题,则可能会崩溃.
// Emitter Pool - (SKEmitterNode*)getEmitter:(NSString*)name { if(!mDictEmitter) self.mDictEmitter = [NSMutableDictionary new]; SKEmitterNode *e = [mDictEmitter objectForKey:name]; if(!E){ NSString *p = [[NSBundle mainBundle] pathForresource:name ofType:@"sks"]; e = [NSKeyedUnarchiver unarchiveObjectWithFile:p]; [mDictEmitter setObject:e forKey:name]; } return [e copy]; }
以上是大佬教程为你收集整理的ios – 什么是Sprite Kit中的SKSpinLockSync以及如何解决它全部内容,希望文章能够帮你解决ios – 什么是Sprite Kit中的SKSpinLockSync以及如何解决它所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。