ribesg
01/08/2020, 1:55 PMval
in companion object
having incorrect value on iOS, anyone saw anything about that? For example I have this in a subclass of UICollectionViewCell
(hence the object superclass):
companion object : UICollectionViewCellMeta() {
const val HEIGHT = 100.0
}
But when I print the value of HEIGHT
anywhere it has a nonsense value, maybe returning a pointer or reading random memory, it returns something like 6e-310. It also does not return the same value every time its read from different instances of the subclass of UICollectionViewCell
. Wtf?
Note: Removing const
doesn’t change anything. No problem if the val
is global, local to the class or a getter (val HEIGHT: Double get() = 100.0
)Kris Wong
01/08/2020, 2:02 PMribesg
01/08/2020, 2:17 PMKris Wong
01/09/2020, 1:55 PMribesg
01/09/2020, 1:57 PMKris Wong
01/09/2020, 1:57 PMribesg
01/09/2020, 1:58 PMribesg
01/09/2020, 1:59 PMKris Wong
01/09/2020, 1:59 PMKris Wong
01/09/2020, 1:59 PMKris Wong
01/09/2020, 2:00 PM__attribute__((unavailable("Kotlin subclass of Objective-C class can't be imported")))
__attribute__((swift_name("FeatureViewController")))
@interface FeatureModuleFeatureViewController : NSObject
@end;
ribesg
01/09/2020, 2:00 PMribesg
01/09/2020, 2:00 PMKris Wong
01/09/2020, 2:01 PMribesg
01/09/2020, 2:53 PM