swift - How can I store a cell height value in a Realm object that is associated with the cell? -
i using realm swift on ios store objects associated uitableviewcell
. each cell of dynamic height, , store height information in realm object well. unfortunately, cannot put code update cell height information in notification block of realm object since trigger infinite loop. tried adding class creates sort of foreign key relationship base object , somehow triggered infinite loop try update other object in notification block.
what best way out problem?
much cocoa's key value observing, realm's notifications indicate object modified if set properties on object, if set properties existing values. triggering notification loop. avoid this, can check within notification block whether you're setting cell height property same value object has. if so, skip updating property.
Comments
Post a Comment