I have CGFloat, but I need it as NSInteger. The float value is 2.0f, so I do not mind fractional parts and loss of precision. What is a legitimate way to convert it to NSInteger immediately (except for loss of accuracy, of course)?
NSInteger niceInt = niceCGFloat;
It seems too simple, it smells like a buggy. Maybe you can explain?
HelloMoon
source share