Re: sorting large tables

2008-03-14 Thread Daniel Child
Actually, since I've parsed the data successfully, I suppose I could store it and reopen in Core Data. Since I am new to Cocoa and have a limited programming background, I thought I should keep things basic,. Will give it a try as well (once I've tried the merge sort). But since I will

Re: sorting large tables

2008-03-13 Thread Jens Alfke
On 13 Mar '08, at 8:52 AM, Daniel Child wrote: I am using sortArrayUsingFunction: context: to sort a fairly large table (100k recs). Judging from the readout of comparisons being made the sort appears to be about 80% done when everything comes to a halt. No message, no nothing. It just

Re: sorting large tables

2008-03-13 Thread Daniel Child
That makes a lot of sense to me, and that's the situation I'm trying to get to. But right now all I have is the original (unsorted) raw data. So I need to load it into memory and sort it. Since the sorting operation hangs some kazillion compare:s into the process, I can't exactly trace my

re: sorting large tables

2008-03-13 Thread Ben Trumbull
Unfortunately, the table is not KVO-compliant so I cannot use NSSortDescriptor. And I need to pass the primary and secondary sort fields at runtime, so I cannot use sortUsingSelector since it takes no parameters. NSSortDescriptor requires an object be *KVC* compliant. It does not use KVO.

Re: sorting large tables

2008-03-13 Thread Jens Alfke
On 13 Mar '08, at 1:42 PM, Daniel Child wrote: That makes a lot of sense to me, and that's the situation I'm trying to get to. But right now all I have is the original (unsorted) raw data. So I need to load it into memory and sort it. You don't necessarily need to sort all of it at once.

Re: sorting large tables

2008-03-13 Thread Daniel Child
On Mar 13, 2008, at 6:24 PM, Jens Alfke wrote: You don't necessarily need to sort all of it at once. You just need to find the first few items, to display in your table view. If the user scrolls past those, you need to find more. You can do this by streaming the data from a file, keeping

Re: sorting large tables

2008-03-13 Thread Nir Soffer
On Mar 14, 2008, at 05:34, Daniel Child wrote: @interface GenericRecord : NSObject NSCopying { NSMutableArray *record; ... plus a couple ivars not used for the sort } Field access is slower because you have to call two methods instead of one - one of the generic recorder, and then the

Re: sorting large tables

2008-03-13 Thread Jens Alfke
On 13 Mar '08, at 8:34 PM, Daniel Child wrote: It sounds like my program shouldn't be freezing in the first place, since my files are not THAT big. Here are the details. The most useful details would involve a sample* of what your program's doing. My guess is that it's just taking an