iOS上的UIFlowLayoutRow看门狗终止崩溃

tsm1rwdh  于 2023-10-21  发布在  iOS
关注(0)|答案(1)|浏览(152)

My app metrics显示某些设备崩溃,并显示以下信息:

Exception Type:  EXC_CRASH (SIGKILL)
Process Visibility: Foreground
Watchdog Event: scene-update (other reports has scene-create)
Watchdog Visibility: Background
Termination Code: 0x8badf00d

堆栈跟踪:

UIKitCore  -[_UIFlowLayoutRow layoutRow]
UIKitCore  -[_UIFlowLayoutRow layoutRow]
UIKitCore  -[_UIFlowLayoutSection computeLayoutInRect:forSection:invalidating:invalidationContext:]
UIKitCore  __76-[UICollectionViewFlowLayout _updateItemsLayoutForRect:allowsPartialUpdate:]_block_invoke
CoreFoundation  __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__
CoreFoundation  -[__NSArrayM enumerateObjectsWithOptions:usingBlock:]
UIKitCore  -[UICollectionViewFlowLayout _updateItemsLayoutForRect:allowsPartialUpdate:]
UIKitCore  -[UICollectionViewFlowLayout _fetchItemsInfoForRect:]
UIKitCore  -[UICollectionViewFlowLayout prepareLayout]
UIKitCore  -[UICollectionViewData _prepareToLoadData]
UIKitCore  -[UICollectionViewData validateLayoutInRect:]
UIKitCore  -[UICollectionViewData layoutAttributesForElementsInRect:]
UIKitCore  -[UICollectionView _indexPathForItemAtPoint:]
UIKitCore  -[UICollectionView indexPathForItemAtPoint:]
MyApp  - [MyAppCollectionViewController gestureRecognizer:shouldReceiveTouch:]
UIKitCore  -[UIGestureRecognizer _delegateShouldReceiveTouch:forEvent:]
UIKitCore  -[UIGestureRecognizer _internalShouldReceiveTouch:forEvent:recognizerView:]
UIKitCore  __80-[UITouchesEvent _addGestureRecognizersForGestureOwner:toTouch:forContinuation:]_block_invoke
UIKitCore  __70-[UITouchesEvent _collectGestureRecognizersForGestureOwner:withBlock:]_block_invoke
UIKitCore  -[UITouchesEvent _collectGestureRecognizersForGestureOwner:withBlock:]
UIKitCore  -[UITouchesEvent _addGestureRecognizersForGestureOwner:toTouch:forContinuation:]
UIKitCore  -[UITouchesEvent _addTouch:forDelayedDelivery:]
UIKitCore  _AddTouchToEventAndDetermineIfNeedsCancel
UIKitCore  ____updateTouchesWithDigitizerEventAndDetermineIfShouldSend_block_invoke.51
CoreFoundation  __NSDICTIONARY_IS_CALLING_OUT_TO_A_BLOCK__
CoreFoundation  ____NSDictionaryEnumerate_block_invoke_2
CoreFoundation  CFBasicHashApply
CoreFoundation  __NSDictionaryEnumerate
UIKitCore  __dispatchPreprocessedEventFromEventQueue
UIKitCore  __processEventQueue
UIKitCore  __eventFetcherSourceCallback
CoreFoundation  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
CoreFoundation  __CFRunLoopDoSource0
CoreFoundation  __CFRunLoopDoSources0
CoreFoundation  __CFRunLoopRun
CoreFoundation  CFRunLoopRunSpecific
GraphicsServices  GSEventRunModal
UIKitCore  -[UIApplication _run]
UIKitCore  UIApplicationMain

Thread ID: 0
Stacktrace:
libsystem_kernel.dylib  poll
MyApp  pollset_work(grpc_pollset*, grpc_pollset_worker**, grpc_core::Timestamp)
MyApp  cq_next(grpc_completion_queue*, gpr_timespec, void*)
MyApp  __27-[GRPCCompletionQueue init]_block_invoke_2
libdispatch.dylib  _dispatch_call_block_and_release
libdispatch.dylib  _dispatch_client_callout
libdispatch.dylib  _dispatch_root_queue_drain
libdispatch.dylib  _dispatch_worker_thread2
libsystem_pthread.dylib  _pthread_wqthread
libsystem_pthread.dylib  start_wqthread

Thread ID: 1
Stacktrace:
libsystem_pthread.dylib  start_wqthread

Thread ID: 2
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
CoreFoundation  __CFRunLoopServiceMachPort
CoreFoundation  __CFRunLoopRun
CoreFoundation  CFRunLoopRunSpecific
Foundation  -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
Foundation  -[NSRunLoop(NSRunLoop) runUntilDate:]
UIKitCore  -[UIEventFetcher threadMain]
Foundation  __NSThread__start__
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 3
Stacktrace:
libsystem_pthread.dylib  start_wqthread

Thread ID: 4
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
MyApp  crashpad::MachMessageWithDeadline(mach_msg_header_t*, int, unsigned int, unsigned int, unsigned long long, unsigned int, bool)
MyApp  crashpad::MachMessageServer::Run()
MyApp  crashpad::(anonymous namespace)::CrashHandler::ThreadMain()
MyApp  crashpad::Thread::ThreadEntryThunk(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 5
Stacktrace:
libsystem_pthread.dylib  start_wqthread

Thread ID: 6
Stacktrace:
libsystem_kernel.dylib  semaphore_timedwait_trap
libdispatch.dylib  _dispatch_sema4_timedwait
libdispatch.dylib  _dispatch_semaphore_wait_slow
MyApp  crashpad::Semaphore::TimedWait(double)
MyApp  crashpad::internal::WorkerThreadImpl::ThreadMain()
MyApp  crashpad::Thread::ThreadEntryThunk(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 7
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
CoreFoundation  __CFRunLoopServiceMachPort
CoreFoundation  __CFRunLoopRun
CoreFoundation  CFRunLoopRunSpecific
CFNetwork  _CFURLStorageSessionDisableCache
Foundation  __NSThread__start__
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 8
Stacktrace:
libsystem_kernel.dylib  semaphore_timedwait_trap
libdispatch.dylib  _dispatch_sema4_timedwait
libdispatch.dylib  _dispatch_semaphore_wait_slow
MyApp  crashpad::Semaphore::TimedWait(double)
MyApp  crashpad::internal::WorkerThreadImpl::ThreadMain()
MyApp  crashpad::Thread::ThreadEntryThunk(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 9
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  gpr_cv_wait
MyApp  grpc_core::Executor::ThreadMain(void*)
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 10
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  gpr_cv_wait
MyApp  grpc_core::Executor::ThreadMain(void*)
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 11
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  gpr_cv_wait
MyApp  timer_thread(void*)
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 12
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  grpc_event_engine::experimental::OriginalThreadPool::Queue::Step()
MyApp  grpc_event_engine::experimental::OriginalThreadPool::StartThread()
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 13
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  grpc_event_engine::experimental::OriginalThreadPool::Queue::Step()
MyApp  grpc_event_engine::experimental::OriginalThreadPool::StartThread()
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 14
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  grpc_event_engine::experimental::OriginalThreadPool::Queue::Step()
MyApp  grpc_event_engine::experimental::OriginalThreadPool::StartThread()
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 15
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  grpc_event_engine::experimental::OriginalThreadPool::Queue::Step()
MyApp  grpc_event_engine::experimental::OriginalThreadPool::StartThread()
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 16
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  grpc_event_engine::experimental::OriginalThreadPool::Queue::Step()
MyApp  grpc_event_engine::experimental::OriginalThreadPool::StartThread()
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 17
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  grpc_event_engine::experimental::OriginalThreadPool::Queue::Step()
MyApp  grpc_event_engine::experimental::OriginalThreadPool::StartThread()
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 18
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::TimedWait(absl::synchronization_internal::KernelTimeout)
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  absl::CondVar::WaitWithTimeout(absl::Mutex*, absl::Duration)
MyApp  grpc_event_engine::experimental::TimerManager::WaitUntil(grpc_core::Timestamp)
MyApp  grpc_event_engine::experimental::TimerManager::MainLoop()
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 19
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
CoreFoundation  __CFRunLoopServiceMachPort
CoreFoundation  __CFRunLoopRun
CoreFoundation  CFRunLoopRunSpecific
CoreFoundation  _legacyStreamRunLoop_workThread
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 20
Stacktrace:
libsystem_kernel.dylib  __select
CoreFoundation  __CFSocketManager
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 21
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
CoreFoundation  __CFRunLoopServiceMachPort
CoreFoundation  __CFRunLoopRun
CoreFoundation  CFRunLoopRunSpecific
CFNetwork  _CFURLStorageSessionDisableCache
Foundation  __NSThread__start__
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 22
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
CoreFoundation  __CFRunLoopServiceMachPort
CoreFoundation  __CFRunLoopRun
CoreFoundation  CFRunLoopRunSpecific
Foundation  -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
MyAppWebView  base::MessagePumpNSRunLoop::DoRun(base::MessagePump::Delegate*)
MyAppWebView  base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*)
MyAppWebView  base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta)
MyAppWebView  base::RunLoop::Run(base::Location const&)
MyAppWebView  base::Thread::Run(base::RunLoop*)
MyAppWebView  base::Thread::ThreadMain()
MyAppWebView  base::(anonymous namespace)::ThreadFunc(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 23
Stacktrace:
libsystem_kernel.dylib  kevent64
MyAppWebView  base::MessagePumpKqueue::DoInternalWork(base::MessagePump::Delegate*, base::MessagePump::Delegate::NextWorkInfo*)
MyAppWebView  base::MessagePumpKqueue::Run(base::MessagePump::Delegate*)
MyAppWebView  base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta)
MyAppWebView  base::RunLoop::Run(base::Location const&)
MyAppWebView  base::Thread::Run(base::RunLoop*)
MyAppWebView  base::internal::ServiceThread::Run(base::RunLoop*)
MyAppWebView  base::Thread::ThreadMain()
MyAppWebView  base::(anonymous namespace)::ThreadFunc(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 24
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
MyAppWebView  base::WaitableEvent::TimedWaitImpl(base::TimeDelta)
MyAppWebView  base::WaitableEvent::TimedWait(base::TimeDelta)
MyAppWebView  base::internal::WorkerThread::Delegate::WaitForWork(base::WaitableEvent*)
MyAppWebView  base::internal::WorkerThread::RunWorker()(
MyAppWebView  base::internal::WorkerThread::RunPooledWorker()
MyAppWebView  base::internal::WorkerThread::ThreadMain()
MyAppWebView  base::(anonymous namespace)::ThreadFunc(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 25
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
MyAppWebView  base::WaitableEvent::TimedWaitImpl(base::TimeDelta)
MyAppWebView  base::WaitableEvent::TimedWait(base::TimeDelta)
MyAppWebView  base::internal::WorkerThread::Delegate::WaitForWork(base::WaitableEvent*)
MyAppWebView  base::internal::WorkerThread::RunWorker()
MyAppWebView  base::internal::WorkerThread::RunBackgroundPooledWorker()
MyAppWebView  base::internal::WorkerThread::ThreadMain()
MyAppWebView  base::(anonymous namespace)::ThreadFunc(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 26
Stacktrace:
libsystem_kernel.dylib  kevent64
MyAppWebView  base::MessagePumpKqueue::DoInternalWork(base::MessagePump::Delegate*, base::MessagePump::Delegate::NextWorkInfo*)
MyAppWebView  base::MessagePumpKqueue::Run(base::MessagePump::Delegate*)
MyAppWebView  base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta)
MyAppWebView  base::RunLoop::Run(base::Location const&)
MyAppWebView  base::Thread::Run(base::RunLoop*)
MyAppWebView  web::WebSubThread::IOThreadRun(base::RunLoop*)
MyAppWebView  base::Thread::ThreadMain()
MyAppWebView  base::(anonymous namespace)::ThreadFunc(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 27
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
MyAppWebView  base::WaitableEvent::TimedWaitImpl(base::TimeDelta)
MyAppWebView  base::WaitableEvent::TimedWait(base::TimeDelta)
MyAppWebView  base::internal::WorkerThread::Delegate::WaitForWork(base::WaitableEvent*)
MyAppWebView  base::internal::WorkerThread::RunWorker()
MyAppWebView  base::internal::WorkerThread::RunPooledWorker()
MyAppWebView  base::internal::WorkerThread::ThreadMain()
MyAppWebView  base::(anonymous namespace)::ThreadFunc(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 28
Stacktrace:
libsystem_kernel.dylib  mach_msg2_trap
libsystem_kernel.dylib  mach_msg2_internal
libsystem_kernel.dylib  mach_msg_overwrite
libsystem_kernel.dylib  mach_msg
MyAppWebView  base::WaitableEvent::TimedWaitImpl(base::TimeDelta)
MyAppWebView  base::WaitableEvent::TimedWait(base::TimeDelta)
MyAppWebView  base::internal::WorkerThread::Delegate::WaitForWork
MyAppWebView  base::internal::WorkerThread::RunWorker()
MyAppWebView  base::internal::WorkerThread::RunBackgroundPooledWorker()
MyAppWebView  base::internal::WorkerThread::ThreadMain()
MyAppWebView  base::(anonymous namespace)::ThreadFunc(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Thread ID: 29
Stacktrace:
libsystem_kernel.dylib  __psynch_cvwait
libsystem_pthread.dylib  _pthread_cond_wait
MyApp  absl::synchronization_internal::PthreadWaiter::TimedWait(absl::synchronization_internal::KernelTimeout)
MyApp  absl::synchronization_internal::PthreadWaiter::Wait(absl::synchronization_internal::KernelTimeout)
MyApp  AbslInternalPerThreadSemWait
MyApp  absl::CondVar::WaitCommon(absl::Mutex*, absl::synchronization_internal::KernelTimeout)
MyApp  absl::CondVar::WaitWithTimeout(absl::Mutex*, absl::Duration)
MyApp  gpr_cv_wait
MyApp  timer_thread(void*)
MyApp  Thread::ThreadBody(void*)
libsystem_pthread.dylib  _pthread_start
libsystem_pthread.dylib  thread_start

Apple Developer forum上有一个类似的未回答的问题。我检查了Apple Watchdog termination documentation,但没有多大帮助。
我试图在我的iPhone或模拟器上重现它,但我不能。以前有人遇到过同样的问题吗?你是如何解决的?

55ooxyrt

55ooxyrt1#

该bug与布局配置有关:
1.我实现了一个自定义的UICollectionViewFlowLayout,其中estimatedItemSize = UICollectionViewFlowLayoutAutomaticSize
1.每个单元都实现了自己的preferredLayoutAttributesFittingAttributes
1.我实现了一个自定义的UICollectionViewController。它实现了UICollectionViewDelegate,并为@selector(collectionView:layout:sizeForItemAtIndexPath:)返回了NO,这样UICollectionView就可以使用自动调整单元格大小,除了一个特殊的单元格,我希望UICollectionView通过调用UICollectionViewDelegate的sizeForItemAtIndexPath来使用手动调整大小。
我的猜测是,在@selector(collectionView:layout:sizeForItemAtIndexPath:)中返回YES的特殊单元格的新逻辑不知何故影响了其他一些单元格并导致崩溃。我通过去掉手动单元格大小调整逻辑来修复它。现在,UICollectionViewDelegate@selector(collectionView:layout:sizeForItemAtIndexPath:)中为所有单元格返回NO,并对所有单元格使用自动单元格大小调整。

相关问题