私はこのような時間の配列を持っています:
(
"2000-01-01 23:48:00 +0000",
"2000-01-01 02:15:00 +0000",
"2000-01-01 04:39:00 +0000",
"2000-01-01 17:23:00 +0000",
"2000-01-01 13:02:00 +0000",
"2000-01-01 21:25:00 +0000"
)
このコードから生成されるもの:
//loop through array and convert the string times to NSDates
NSDateFormatter *timeFormatter = [[NSDateFormatter alloc] init];
[timeFormatter setDateFormat:@"hh:mm a"];
NSMutableArray *arrayOfDatesAsDates = [NSMutableArray array];
for (NSObject* o in arrayTimes)
{
NSLog(@"%@",o);
NSDate *nsDateTime = [timeFormatter dateFromString:o];
[arrayOfDatesAsDates addObject:nsDateTime];
}
NSLog(@"times array: %@", arrayOfDatesAsDates);//
次の配列で時間を取得しようとしているため、これを行っています。私の計画は、過去の時間を削除して並べ替え、最初の時間を次回として使用することです。
過去のものを削除するにはどうすればよいですか?
ありがとうございました