Сбой: com.apple.main-thread BasePostCell.collectionView (_: cellForItemAt :) - PullRequest
0 голосов
/ 13 марта 2020

У меня есть cra sh от crashlytics, вы можете сказать, где причина этого? Подключен ли он к AuthManager или BasePostCell?

Crashed: com.apple.main-thread
0  goForDream                     0x1023f22ac BasePostCell.collectionView(_:cellForItemAt:) + 4304741036 (<compiler-generated>:4304741036)
1  goForDream                     0x1023f2340 @objc BasePostCell.collectionView(_:cellForItemAt:) + 4304741184 (<compiler-generated>:4304741184)
2  UIKitCore                      0x19ae22d00 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 444
3  UIKitCore                      0x19ae249c8 -[UICollectionView _prefetchItemsForPrefetchingContext:maxItemsToPrefetch:] + 476
4  UIKitCore                      0x19ae2c4fc -[UICollectionView layoutSubviews] + 1020
5  UIKitCore                      0x19baa48b0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2156
6  libobjc.A.dylib                0x197204a4c -[NSObject performSelector:withObject:] + 68
7  QuartzCore                     0x19e0ba55c -[CALayer layoutSublayers] + 292
8  QuartzCore                     0x19e0ba9ac CA::Layer::layout_if_needed(CA::Transaction*) + 484
9  QuartzCore                     0x19e0cd1bc CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 140
10 QuartzCore                     0x19e011b00 CA::Context::commit_transaction(CA::Transaction*, double) + 308
11 QuartzCore                     0x19e03c910 CA::Transaction::commit() + 684
12 QuartzCore                     0x19e03d4e4 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 96
13 CoreFoundation                 0x19746b524 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
14 CoreFoundation                 0x1974661c4 __CFRunLoopDoObservers + 420
15 CoreFoundation                 0x197466774 __CFRunLoopRun + 1292
16 CoreFoundation                 0x197465f40 CFRunLoopRunSpecific + 480
17 GraphicsServices               0x1a16f6534 GSEventRunModal + 108
18 UIKitCore                      0x19b5f1580 UIApplicationMain + 1940
19 goForDream                     0x1021a03a8 main + 26 (AuthManager.swift:26)
20 libdyld.dylib                  0x1972e4e18 start + 4

Код CollectionViewDelegate:

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    return assets.count == 1 ? 0 : assets.count
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCell(for: indexPath) as FeedPostCarouselCollectionViewCell
    if !assets.isEmpty {
        let photo = assets[indexPath.row]
        cell.configure(with: photo)
    }
    return cell
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...