Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrFusion

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
Hi

Does anyone know if the order is guaranteed when fetching objects from an NSArrayController with arrangedObjects? Assuming that I do not provide filters or sortdescriptors.
I have to fetch objects from core data. Calculate stuff and return the data to the objects in the exact same order as I originally fetched the objects.

Or do I have to override this method to ensure the same order?
Code:
- (NSArray *)arrangeObjects:(NSArray *)objects

I would say yes, of course. Both from the name of the method and my experience with NSTableviews binded to arrangedObjects.
But the documentation does not state it explicitly and I have to be 100% sure.
 

HiRez

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
No, the order is not guaranteed at all, even between fetches on an unmodified array. You will need to provide sort descriptors (or set the default ones in IB), or as you say provide your own custom filtering by overriding arrangeObjects:
 

MrFusion

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
No, the order is not guaranteed at all, even between fetches on an unmodified array. You will need to provide sort descriptors (or set the default ones in IB), or as you say provide your own custom filtering by overriding arrangeObjects:

Ok.
Thanks for the reply.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.