Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i know when to use Integer16/32/64 or float/int/double/decimal in core data?

Tags:

ios

iphone

What are the benefits/downsides between using the NSInteger (or NSNumber) and float/int?

What exactly is decimal??

Thank you!

like image 927
bubbles Avatar asked Dec 27 '22 14:12

bubbles


1 Answers

NSInteger is just a type def of int when using it on the iPhone, but on OSX will change form 32 bit int to 64 bit int if you build your code for a 64 bit machine.

NSNumber is an object that can hold any type of number, being float, integer, double, long ect..

NSDecimal is a struct which will tell you about some detail about the floating point value of a NSNumber.

NSDecimalNumber is a subclass of NSNumber which can hold a more exact floating point value: see @dreanlax comment

like image 177
rckoenes Avatar answered Dec 30 '22 03:12

rckoenes