それが完全に機能するほんの少し前で、突然何が起こったのかわからず、何も変更されていませんが、もう機能していません。
これは私の日付が私のsqliteデータベースにある方法です 01/20/1978
01/20/2013
02/28/1979
MM/dd/yyyy
NSLog(@"Fetching holidays from the database between %@ and %@...", fromDate, toDate);
// fromdate and todate both are nsdate this is what they prints
// Fetching holidays from the database between 2013-06-29 18:30:00 +0000 and 2013-08-03 18:29:59 +0000...
NSDateFormatter *fmt = [[[NSDateFormatter alloc] init] autorelease];
NSString *query4 = [[NSString alloc] initWithFormat:@"select Birthdates,Names,Profilepic,Email,Phonenumber from PersonNamesAndBirthDates where Birthdates between ? and ?"];
sqlite3_stmt *stmt4;
int x4 = sqlite3_prepare_v2(database1,[query4 UTF8String],-1, &stmt4, nil);
if (x4 == SQLITE_OK)
[fmt setDateFormat:@"MM/dd/yyyy"];
sqlite3_bind_text(stmt4, 1, [[fmt stringFromDate:fromDate] UTF8String], -1, SQLITE_STATIC);
sqlite3_bind_text(stmt4, 2, [[fmt stringFromDate:toDate] UTF8String], -1, SQLITE_STATIC);
//**IT WAS GOING IN WHILE BUT NOW ITS NOT GOING IN SO IT JUST JUMP FROM HERE**
while(sqlite3_step(stmt4) == SQLITE_ROW)
{
NSString *name = [NSString stringWithUTF8String:(char *)sqlite3_column_text(stmt4, 0)];
NSString *proPic = [NSString stringWithUTF8String:(char *)sqlite3_column_text(stmt4, 1)];
NSString *email = [NSString stringWithUTF8String:(char *)sqlite3_column_text(stmt4, 2)];
NSString *pNumber = [NSString stringWithUTF8String:(char *)sqlite3_column_text(stmt4, 3)];
NSString *bDate = [NSString stringWithUTF8String:(char *)sqlite3_column_text(stmt4, 4)];
[holidays addObject:[Holiday holidayNamed:name email:email profilePic:proPic phoneNumber:pNumber date:[fmt dateFromString:bDate]]];
NSLog(@"%@",holidays);
}
sqlite3_finalize(stmt4);
NSLog(@"%@",holidays);
sqlite3_close(database1);
[delegate loadedDataSource:self];
}