のentity
オブジェクトを含む があります。 今日の のを持つオブジェクトのみを使用NSDate (format yyyy-MM-dd)
して を実行したいと思います。だから私は次のことをやっています。fetch request
NSDate
NSDate *now = [NSDate new];
RKManagedObjectStore *store = [[DominoDataModel sharedDataModel] objectStore];
NSManagedObjectContext *context = store.mainQueueManagedObjectContext;
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Event"];
NSPredicate *predicate = [NSPredicate predicateWithFormat:
@"eve_date = %@",now];
fetchRequest.predicate = predicate;
NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:@"eve_date" ascending:YES];
fetchRequest.sortDescriptors = @[descriptor];
NSArray *matches = [context executeFetchRequest:fetchRequest error:nil];
arrConcerten = [matches mutableCopy];
NSLog(@"matches %@",matches);
MyNSLog
は常に一致を返しません。
誰かがこれで私を助けることができますか?
編集
私のエンティティには、次のような NSDates が含まれています。
2013/08/29
2013/08/30
2013/09/02
2013/09/15
2013/09/28
これらのNSDatesを今日の日付と比較できると思いましたか? しかし、私のエンティティの NSDates にはタイムスタンプがないため、これはおそらく機能していませんか?