我目前正在使用Spritekit
在Swift
开发一个应用。该应用程序在设备和模拟器中完美运行,直到我更新到Xcode 6 Beata 3和iOS 8 Beta 3.当我在模拟器中运行应用程序时,一切仍然完美。但是,当我创建exc_bad_acces
时,在设备上运行应用会导致SKTextureAtlas
。是否有人面临类似的问题或任何人都可以帮我解决这个问题。
我已尝试在iOS8 Beta 2的设备上运行它,但我遇到了同样的错误。我也删除了应用程序,但在设备上运行应用程序时也没有解决我的问题。
这是崩溃的地方:
var atlas = SKTextureAtlas(named: "ImageSet")
,这是来自设备的日志:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xfffffffc
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libswift_stdlib_core.dylib 0x003a737e 0x286000 + 1184638
1 My Game 0x000f6900 Swift._doesImplicitlyUnwrappedOptionalHaveValue <A>(@inout A!) -> Builtin.Int1 (ComputerPlayer.swift:0)
2 My Game 0x0011c0a0 @!objc ObjectiveC.SKTextureAtlas.__allocating_init (ObjectiveC.SKTextureAtlas.Type)(named : Swift.String!) -> ObjectiveC.SKTextureAtlas (SpriteKit-1CMA4777KYE20.pcm:1)
3 My Game 0x0010e010 My_Game.GameScene.didMoveToView (My_Game.GameScene)(ObjectiveC.SKView) -> () (GameScene.swift:132)
4 My Game 0x00113218 @objc My_Game.GameScene.didMoveToView (My_Game.GameScene)(ObjectiveC.SKView) -> () (GameScene.swift:0)
5 SpriteKit 0x2e6d6340 SKGenerateNormalMap + 65680
6 SpriteKit 0x2e6f02de SKGenerateNormalMap + 172078
7 My Game 0x0011fd38 My_Game.GameViewController.viewWillLayoutSubviews (My_Game.GameViewController)() -> () (GameViewController.swift:71)
8 My Game 0x00121468 @objc My_Game.GameViewController.viewWillLayoutSubviews (My_Game.GameViewController)() -> () (GameViewController.swift:0)
9 UIKit 0x2e844266 0x2e837000 + 53862
10 QuartzCore 0x2e2804c0 CABackingStoreGetTypeID + 892
11 QuartzCore 0x2e27bea0 CARenderServerGetServerPort + 5364
12 QuartzCore 0x2e27bd28 CARenderServerGetServerPort + 4988
13 QuartzCore 0x2e27b70c CARenderServerGetServerPort + 3424
14 QuartzCore 0x2e27b510 CARenderServerGetServerPort + 2916
15 UIKit 0x2eaa6cf8 _UIApplicationIsExtension + 4936
16 UIKit 0x2eaa79e0 _UIApplicationIsExtension + 8240
17 UIKit 0x2eab1a68 _UIApplicationUsesAlternateUI + 38388
18 UIKit 0x2eaa5ec8 _UIApplicationIsExtension + 1304
19 FrontBoardServices 0x319bd04e _FBSLog + 2198
20 CoreFoundation 0x2b1692d2 CFRunLoopTimerSetTolerance + 5878
21 CoreFoundation 0x2b168594 CFRunLoopTimerSetTolerance + 2488
22 CoreFoundation 0x2b166d16 _CFRunLoopGet2b + 2174
23 CoreFoundation 0x2b0b624c CFRunLoopRunSpecific + 472
24 CoreFoundation 0x2b0b605e CFRunLoopRunInMode + 102
25 UIKit 0x2e8ab5ba _UISharedImageSetLoadFactor + 3906
26 UIKit 0x2e8a6844 UIApplicationMain + 1436
27 My Game 0x0012a940 top_level_code (AppDelegate.swift:0)
28 My Game 0x0012a97c main (AppDelegate.swift:0)
29 libdyld.dylib 0x385aaaac _tlv_atexit + 8
谢谢
答案 0 :(得分:3)
尝试在项目上运行Clean,一些人在更新时遇到了访问不良的问题,包括我。有些人用干净的方法解决了这个问题,有些则用新的项目副本解决了。