我收到了我的應用程序的崩潰報告,這似乎是在滾動UICollectionView
時發生的。這是一個很少發生的崩潰,並且當我設法在Xcode中捕獲它時,也不知道導致它的代碼片段。我UICollectionView
基本上看起來像一個UITableView
有三種不同類型的細胞 - 一個帶有UILabel
中,一個在一個UIImageView
和UILabel
,和一個在一個AVPlayer
和UILabel
- [CALayer setFrame:] crash
這是崩潰日誌:
-[__NSArrayM setBounds:]: unrecognized selector sent to instance 0x1744478c0
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x18ecb61c0 __exceptionPreprocess
1 libobjc.A.dylib 0x18d6f055c objc_exception_throw
2 CoreFoundation 0x18ecbd278 __methodDescriptionForSelector
3 CoreFoundation 0x18ecba278 ___forwarding___
4 CoreFoundation 0x18ebb459c _CF_forwarding_prep_0
5 QuartzCore 0x191fc625c -[CALayer setFrame:]
6 QuartzCore 0x191fc2e64 CA::Layer::layout_if_needed(CA::Transaction*)
7 QuartzCore 0x191fc2d24 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
8 QuartzCore 0x191f3f7ec CA::Context::commit_transaction(CA::Transaction*)
9 QuartzCore 0x191f66c58 CA::Transaction::commit()
10 MediaToolbox 0x195b5013c playerremote_Invalidate
11 MediaToolbox 0x195bd5ca4 playerasync_InvalidateOnQueue
12 libdispatch.dylib 0x18db411c0 _dispatch_client_callout
13 libdispatch.dylib 0x18db4f444 _dispatch_queue_serial_drain
14 libdispatch.dylib 0x18db449a8 _dispatch_queue_invoke
15 libdispatch.dylib 0x18db4f940 _dispatch_queue_override_invoke
16 libdispatch.dylib 0x18db5138c _dispatch_root_queue_drain
17 libdispatch.dylib 0x18db510ec _dispatch_worker_thread3
18 libsystem_pthread.dylib 0x18dd4a2b8 _pthread_wqthread
19 libsystem_pthread.dylib 0x18dd49da4 start_wqthread
我該如何解決這個問題?
你可以設置異常斷點並添加崩潰方法嗎? –
檢查https://www.natashatherobot.com/xcode-debugging-trick/ –
要進行調試,請使用[啓用殭屍]運行您的應用程序(http://help.apple.com/xcode/mac/8.0/#/ devcef23c572)。 –