2010年3月22日月曜日

SQLite3 Experiment

- (void)loadNamesFromDatabase

{

NSString *file = [[NSBundle mainBundle] pathForResource:@"records" ofType:@"db"];

sqlite3 *database = NULL;

if (sqlite3_open([file UTF8String], &database) == SQLITE_OK) {

sqlite3_exec(database, "SELECT game FROM records", MyCallback, records, NULL);

}

sqlite3_close(database);

}


- (IBAction)addNewRecord:(id)sender{

NSLog(@"addnew");

[self insertNew];

}


-(void)insertNew{

NSString *file = [[NSBundle mainBundle] pathForResource:@"records" ofType:@"db"];

sqlite3 *database = NULL;

if (sqlite3_open([file UTF8String], &database) == SQLITE_OK) {

sqlite3_exec(database, "insert into records (game, number, time) values (0,1,50)", MyCallback, records, NULL);

}

sqlite3_close(database);

}


2010年3月17日水曜日

About The iPhone


iPhone is a good and unique platform to build an application. However just like other platform, to develop a great application we need to learn it constantly. I hope I can follow an advise from Japanese developer to learn iPhone SDK at least 3 hours a day.