In Xcode, the compiler is complaining about the following cast:
CGFloat width = 5.6f;
NSInteger num = (NSInteger)floor(width);
Saying "cast from function call of type 'double' to non-matching type 'NSInteger' (aka 'int')"
One workaround would be to simply cast the CGFloat to NSInteger which truncates but I want to make the code clear/easy to read by explicitly flooring. Is there a function for flooring that returns an int? Or some other (clean) way of doing this?
My compiler settings under "Apple LLVM 6.0 - Compiler Flags", in "Other C Flags", I have -O0 -DOS_IOS -DDEBUG=1 -Wall -Wextra -Werror -Wnewline-eof -Wconversion -Wendif-labels -Wshadow -Wbad-function-cast -Wenum-compare -Wno-unused-parameter -Wno-error=deprecated
Thanks!