找不到swift中致命错误的确切原因(exc_breakpoint)

时间:2018-04-14 17:13:10

标签: ios swift jsqmessagesviewcontroller

我目前正在使用Crashlytics收集用户遇到的错误,其中一个错误显示如下。我无法重现错误或找不到原因,因为我不太了解日志。

0  myapp                       0x10065b254 specialized 
ChatViewController.collectionView(_:messageDataForItemAt:) (ChatViewController.swift:693)
1  myapp                       0x100652ed0 @objc ChatViewController.collectionView(_:messageDataForItemAt:) + 4299091664
2  JSQMessagesViewController      0x10112d0dc -[JSQMessagesCollectionViewFlowLayout messageBubbleSizeForItemAtIndexPath:] (JSQMessagesCollectionViewFlowLayout.m:407)
3  JSQMessagesViewController      0x10112d2c0 -[JSQMessagesCollectionViewFlowLayout jsq_configureMessageCellLayoutAttributes:] (JSQMessagesCollectionViewFlowLayout.m:434)
4  JSQMessagesViewController      0x10112c828 __73-[JSQMessagesCollectionViewFlowLayout layoutAttributesForElementsInRect:]_block_invoke (JSQMessagesCollectionViewFlowLayout.m:310)
5  CoreFoundation                 0x182fb54d0 -[__NSFrozenArrayM enumerateObjectsWithOptions:usingBlock:] + 160
6  JSQMessagesViewController      0x10112c77c -[JSQMessagesCollectionViewFlowLayout layoutAttributesForElementsInRect:] (JSQMessagesCollectionViewFlowLayout.m:308)
7  UIKit                          0x18c4bfca4 __45-[UICollectionViewData validateLayoutInRect:]_block_invoke + 252
8  UIKit                          0x18c4bf600 -[UICollectionViewData validateLayoutInRect:] + 1500
9  UIKit                          0x18c4bea40 -[UICollectionView layoutSubviews] + 260
10 UIKit                          0x18c462304 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1276
11 QuartzCore                     0x18701bec8 -[CALayer layoutSublayers] + 184
12 QuartzCore                     0x18701ffa8 CA::Layer::layout_if_needed(CA::Transaction*) + 332
13 QuartzCore                     0x186f8ea98 CA::Context::commit_transaction(CA::Transaction*) + 336
14 QuartzCore                     0x186fb4eb4 CA::Transaction::commit() + 540
15 QuartzCore                     0x186f09a04 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 928
16 IOKit                          0x1832981cc IODispatchCalloutFromCFMessage + 392
17 CoreFoundation                 0x182fbc010 __CFMachPortPerform + 188
18 CoreFoundation                 0x182fd696c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
19 CoreFoundation                 0x182fd6070 __CFRunLoopDoSource1 + 440
20 CoreFoundation                 0x182fd3b44 __CFRunLoopRun + 2196
21 CoreFoundation                 0x182ef3fb8 CFRunLoopRunSpecific + 436
22 GraphicsServices               0x184d8bf84 GSEventRunModal + 100
23 UIKit                          0x18c4c82f4 UIApplicationMain + 208
24 myapp                       0x100627470 main (AppDelegate.swift:22)
25 libdyld.dylib                  0x182a1656c start + 4

以下是ChatViewControler ln 693

上的代码
(line 693 ->) override func collectionView(_ collectionView: JSQMessagesCollectionView!, messageDataForItemAt indexPath: IndexPath!) -> JSQMessageData! {
    return self.messages[indexPath.row]
}

这是来自JSQMessagesCollectionViewFlowLayout

的一些来源
- (CGSize)messageBubbleSizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    (line 407 ->) id<JSQMessageData> messageItem = [self.collectionView.dataSource collectionView:self.collectionView
                                                      messageDataForItemAtIndexPath:indexPath];

    return [self.bubbleSizeCalculator messageBubbleSizeForMessageData:messageItem
                                                          atIndexPath:indexPath
                                                           withLayout:self];
}

有人能为我提供一些见解,以便我能解决这个问题吗?谢谢。

更新

  1. 通常情况下会出现Fatal Exception: NSInternalInconsistencyException之类的错误,并附上一些说明。

    我无法找到任何有关此致命错误的内容。下面的FYR是一个 截图

    Crashlytics exc_exception screenshot

0 个答案:

没有答案