Hello everyone,
i have one problem when i sort the NSMutablearray using date and time wise.
Does anyone have idea how can i sorted array date and time wise
Thanks in advance
Hello everyone,
i have one problem when i sort the NSMutablearray using date and time wise.
Does anyone have idea how can i sorted array date and time wise
Thanks in advance
The NSArray/NSMutableArray classes contain a method...
- (void)sortUsingSelector:(SEL)comparator
Which you can call passing in the following selector...
@selector(compare:)
This uses the NSDate classes compare method to perform the sorting. An alternative would be to create a NSSortDescriptor object and pass it to the NSMutableArray's sortUsingDescriptors method.
Here is the date format 04/13/2010 which get in xml file...
NSSortDescriptor *filter = [[NSSortDescriptor alloc] initWithKey:@"dateTime" ascending:FALSE];
[appDelegate.arrayWYWOMessage sortUsingDescriptors:[NSArray arrayWithObject:filter]];
but same problem, i am not getting perfect list
can you have any sample code.