也许有人可以帮助,我正试图移动我的应用程序,以促进Apple TV的新目标。我创建了新的故事板,并以与iOS应用程序相同的方式链接所有内容。当我试图启动应用程序时,我得到以下异常,在AppDelegate
执行之后(在它进入初始控制器的viewDidLoad
之前)。
任何想法?
2015-09-19 12:24:44.629 App TV[46733:3797033] *** Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CATransformLayer: 0x7fc1e0d51fc0> is a part of cycle in its layer tree'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e850105 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010f271deb objc_exception_throw + 48
2 CoreFoundation 0x000000010e85003d +[NSException raise:format:] + 205
3 QuartzCore 0x0000000111d2f74a _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 102
4 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
5 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
6 QuartzCore 0x0000000111d2f795 _ZN2CA5Layer30ensure_transaction_recursivelyEPNS_11TransactionE + 177
7 QuartzCore 0x0000000111d37439 _ZN2CA5Layer15insert_sublayerEPNS_11TransactionEP7CALayerm + 389
8 QuartzCore 0x0000000111d3782a -[CALayer addSublayer:] + 193
9 UIKit 0x000000010d2ce424 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1512
10 UIKit 0x000000010d5b1b56 -[UIButton initWithCoder:] + 1424
11 UIKit 0x000000010d79dd62 UINibDecoderDecodeObjectForValue + 705
12 UIKit 0x000000010d79da98 -[UINibDecoder decodeObjectForKey:] + 278
13 UIKit 0x000000010d5d1315 -[UIRuntimeConnection initWithCoder:] + 134
14 UIKit 0x000000010d5d1a77 -[UIRuntimeEventConnection initWithCoder:] + 60
15 UIKit 0x000000010d79dd62 UINibDecoderDecodeObjectForValue + 705
16 UIKit 0x000000010d79df23 UINibDecoderDecodeObjectForValue + 1154
17 UIKit 0x000000010d79da98 -[UINibDecoder decodeObjectForKey:] + 278
18 UIKit 0x000000010d5d0555 -[UINib instantiateWithOwner:options:] + 1255
19 UIKit 0x000000010d3ad7f2 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
20 UIKit 0x000000010d3ae11e -[UIViewController loadView] + 178
21 UIKit 0x000000010d3ae47d -[UIViewController loadViewIfRequired] + 139
22 UIKit 0x000000010d3aec7e -[UIViewController view] + 27
23 UIKit 0x000000010d289484 -[UIWindow addRootViewControllerViewIfPossible] + 61
24 UIKit 0x000000010d289b81 -[UIWindow _setHidden:forced:] + 302
25 UIKit 0x000000010d29b558 -[UIWindow makeKeyAndVisible] + 43
26 UIKit 0x000000010d216063 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
27 UIKit 0x000000010d21c5a8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1755
28 UIKit 0x000000010d219783 -[UIApplication workspaceDidEndTransaction:] + 188
29 FrontBoardServices 0x000000011097b7ac -[FBSSerialQueue _performNext] + 192
30 FrontBoardServices 0x000000011097bb1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45
31 CoreFoundation 0x000000010e77c1b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
32 CoreFoundation 0x000000010e7720dc __CFRunLoopDoSources0 + 556
33 CoreFoundation 0x000000010e771593 __CFRunLoopRun + 867
34 CoreFoundation 0x000000010e770fa8 CFRunLoopRunSpecific + 488
35 UIKit 0x000000010d2190d5 -[UIApplication _run] + 402
36 UIKit 0x000000010d21de09 UIApplicationMain + 171
37 App TV 0x000000010d0b8fdd main + 109
38 libdyld.dylib 0x00000001149699e9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
有趣的事情发生了,显然新的Apple TV(第四代/tvOS v9.0)不能处理按钮上的"换行",在将其设置为"截断中间"后,它启动得很好。可能是测试版的问题
在Xcode 7.2上,我有同样的错误,因为将按钮上的换行设置为'字符换行'。更改为"截断中间"停止崩溃。
您可以通过激活异常断点来通知异常发生的位置,然后您将能够看到发生了什么。
你可以通过Xcode上的断点导航器,然后在左下角的+按钮。