objective c - Ordered Sets and Core Data (NSOrderedSet) -
i have list of share prices properties datetime
, value
.
currently sorting share prices when fetching them using sort descriptor.
now, change code , store them in sorted order faster retrieve current share price (datetime = max).
i inserting share prices 1 one using
shareprice *priceitem= [nsentitydescription insertnewobjectforentityforname:@"shareprice" inmanagedobjectcontext:context];
how can sort share prices right after inserting them using sort descriptor on datetime
?
or need convert nsmutableorderedset
, use sortusingcomparator:
?
thank you!
mark ordered checkbox of property in coredata model.
also sure set coredata automatic migration in appdelegate (options dictionary when creating persistentstore). way coredata able make change without data lost.