ios - exc_arithmetic error with simulator only, assigning UICollectionView flowlayout -
im trying assign uicollectionviewflowlayout
uicollectionview
, runs fine on physical device simulators break, signal:
exc_arithmetic(code=exc_i386_div, subcode=0x0)
this happens on simulator, understanding division 0 error, dont see how thats possible implementation
code:
let flowlayout: uicollectionviewflowlayout = uicollectionviewflowlayout() flowlayout.itemsize = cgsizemake(self.view.bounds.width * 0.67, self.collectionview!.frame.height - 10) flowlayout.scrolldirection = uicollectionviewscrolldirection.horizontal self.collectionview!.collectionviewlayout = flowlayout
furthermore, signal @ line: self.collectionview!.collectionviewlayout = flowlayout
and view bounds : width: 277.38 height: 75.0
any help, or alternatives appreciated!
i got exact same issue on old code working on , appears calling code wrong method. moved in more appropriate place, viewdidload or init , works.
Comments
Post a Comment