the text-copy of the message log is sorted by date
This commit is contained in:
parent
13e09a0185
commit
a9c20a36ca
|
@ -194,10 +194,15 @@
|
||||||
|
|
||||||
- (void) writeToFile: (id) sender
|
- (void) writeToFile: (id) sender
|
||||||
{
|
{
|
||||||
|
//make the array sorted by date
|
||||||
|
NSSortDescriptor * descriptor = [[[NSSortDescriptor alloc] initWithKey: @"Date" ascending: YES] autorelease];
|
||||||
|
NSArray * descriptors = [[NSArray alloc] initWithObjects: descriptor, nil];
|
||||||
|
NSArray * sortedMessages = [fMessages sortedArrayUsingDescriptors: descriptors];
|
||||||
|
[descriptors release];
|
||||||
|
|
||||||
//create the text to output
|
//create the text to output
|
||||||
NSMutableArray * messageStrings = [NSMutableArray arrayWithCapacity: [fMessages count]];
|
NSMutableArray * messageStrings = [NSMutableArray arrayWithCapacity: [fMessages count]];
|
||||||
|
NSEnumerator * enumerator = [sortedMessages objectEnumerator];
|
||||||
NSEnumerator * enumerator = [fMessages objectEnumerator];
|
|
||||||
NSDictionary * message;
|
NSDictionary * message;
|
||||||
while ((message = [enumerator nextObject]))
|
while ((message = [enumerator nextObject]))
|
||||||
[messageStrings addObject: [self stringForMessage: message]];
|
[messageStrings addObject: [self stringForMessage: message]];
|
||||||
|
|
Loading…
Reference in New Issue