【问题标题】:Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes在 UICollectionViewFlowLayoutBreakForInvalidSizes 处创建一个符号断点
【发布时间】:2016-05-29 14:25:51
【问题描述】:

我在我的代码中遇到了这个错误,它说“在UICollectionViewFlowLayoutBreakForInvalidSizes 处创建一个符号断点以在调试器中捕获它。”我很困惑它实际上在这里问的是我认为它要求将它放在哪里只是不确定的代码?

import UIKit

// MARK: - CUSTOM SOCIAL CELL
class SocialCell:UICollectionViewCell {

    /* Views */
    @IBOutlet weak var socialIcon: UIImageView!
    @IBOutlet weak var socialLabel: UILabel!
}

class SocialList: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {

    /* Views */
    @IBOutlet weak var socialCollView: UICollectionView!

    override func viewDidLoad() {
        super.viewDidLoad()

    }

    // MARK: - COLLECTION VIEW DELEGATES 
    func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
        return 1
    }

    func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return socials.count //socialNames.count
    }

    func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("SocialCell", forIndexPath: indexPath) as! SocialCell

        cell.socialLabel.text = "\(socials[indexPath.row]["name"]!)"
        cell.socialIcon.image = UIImage(named: "\(socials[indexPath.row]["name"]!)")

        return cell
    }

    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
        return CGSizeMake(view.frame.size.width/3.8, view.frame.size.width/3.8)
    }

    func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
        selectedSocial = "\(socials[indexPath.row]["link"]!)"
        selectedName = "\(socials[indexPath.row]["name"]!)"
        selectedColor = socialColors[indexPath.row]

        navigationController?.popViewControllerAnimated(true)
    }
}

【问题讨论】:

    标签: ios xcode uicollectionview swift2


    【解决方案1】:

    您可以通过这样做系统地解决这个问题:

    另外,您应该分享您的完整错误,以便我可以引导您解决更具体的问题。我的想法是您的 UICollectionView 中存在某种自动布局问题

    在您的项目左侧,单击断点导航器

    接下来点击左下角的加号按钮,然后点击Add Symbolic BreakPoint

    然后您将看到一个弹出窗口。像这样在其中添加 UICollectionViewFlowLayoutBreakForInvalidSizes

    在此之后,只需按 Enter(在键盘上)并单击任意位置

    运行您的代码并查看项目停止的位置

    【讨论】:

    • 好吧,完美,所以我这样做并再次运行该应用程序以加载 Facebook 页面,但是当我单击添加照片时,它只是刷新了页面,它之前做得很好,它只是在 Xcode 中拉起这个:
    • UIKit`UICollectionViewFlowLayoutBreakForInvalidSizes: -> 0x1123ebabc : pushq %rbp 0x1123ebabd : movq %rsp, %rbp 0x1123ebac0 : testq %rdi, %rdi 0x1123ebac3 : je 0x1123ebac7 ; 0x1123ebac5 : popq %rbp 0x1123ebac6 : retq 0x1123ebac7 : leaq 0x4a1042(%rip), %rdi ; @"''" 0x1123ebace : xorl %eax, %eax 0x1123ebad0 : popq %rbp 0x1123ebad1 : jmp 0x1125b3e90 ;符号存根:NSLog
    • @ThreeSuitStudiosLLC 你知道如何理解内存句柄吗?
    • @RizwanAhmed 很高兴它有帮助:)
    • 但是当它停止时,它会向我展示一系列难以理解的汇编语句。下一步是什么?
    猜你喜欢
    • 2018-10-13
    • 2015-05-11
    • 1970-01-01
    • 1970-01-01
    • 2012-01-26
    • 2019-03-03
    • 1970-01-01
    • 2018-07-14
    • 1970-01-01
    相关资源
    最近更新 更多