NSSortDescriptor for NSFetchRequest sorting unexpectedly

Posted by E-Madd on Stack Overflow See other posts from Stack Overflow or by E-Madd
Published on 2010-05-21T02:12:03Z Indexed on 2010/05/21 2:20 UTC
Read the original article Hit count: 311

Filed under:
|

My entity has a property (sortOrder) that is of the type Decimal(NSDecimalNumber) but when I execute a fetch request using that property as a key, I get back results in a seemingly random order. If I output the value of the property I get really strange values until I get it's intValue.

Example: The first run produces this result. The first value is the raw value of the property. The second is the intValue, the actual value of the property when I created the object - or at least I thought.

85438160 10 74691424 20

Second run...

85333744 10 85339168 20

Third...

85263696 20 85269568 10

What the hell?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about coredata