I have the following code:
self.temporaryImageArray = [(NSSet *)[[array objectAtIndex:0] images] allObjects]
Array holds an Band object from my CoreData model. It has an NSSet as a property called “images”.
Now I use this temporaryImageArray to determine via timestamps whether or not the images need to be updated. I have come across some very random behavior and my question now is:
Does [NSSet allObjects] return the Objects from the Set randomly in no order?
Is there any way to prevent this or to have it return it in order? It would lessen the complexity of my code a lot.
A set does not have order. However, in 10.7 (Lion), there is an NSOrderedSet class. This isn’t available in iOS 4.0.