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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -