I have the following code...
[sortedTripDatesList removeAllObjects];
[sortedTripDatesList addObjectsFromArray:[tempArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]];
tempArray is a NSMutableArray of NSDates (event dates). If there is more than one item in the array xCode throws an unrecognized selector exception...
'-[__NSDate caseInsensitiveCompare:]: unrecognized selector sent to instance 0x4f66dd0'
I believe that this is because the objects in the array are NSDates. After reading the documentation and multiple google searches I am thoroughly confused on how to sort an array of dates.
Actually I have had this code running for some time now and never noticed a problem until today. Perhaps I never had more than 1 date in the array before today, but I find this hard to believe as I have been testing this app now for many months and certainly would have entered more than one event at some point during the testing.
What is the proper way to do this? Any help wold be appreciated.
John