Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes

I am getting this error in my code it says to "Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger." I am confused as to what it is actually asking here is the code in which I am thinking its asking it to be put in just not sure where?

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)
    }
}
like image 543
Three Suit Studios LLC Avatar asked May 29 '16 14:05

Three Suit Studios LLC


1 Answers

You can systematically solve this by doing this:

Also, you should share your complete error, so that I can lead you to more specific issue. My thinking is that you have some sort of autoLayout issue in your UICollectionView

On the left of your project, click the Break Point navigator

enter image description here

Next click on the plus button on the bottom left and click Add Symbolic BreakPoint

enter image description here

Then you will be shown a popup. Add UICollectionViewFlowLayoutBreakForInvalidSizes in there like so

enter image description here

After this, just hit enter(on keyboard) and click anywhere

Run your code and see where the project stops

like image 58
Akshansh Thakur Avatar answered Nov 10 '22 23:11

Akshansh Thakur