when i selecting row from table view for update.the data are not updated into database why i need the code for tableview update and delete
I'm new in developing for iPhone. I'm using a tableview. In that table I'm displaying an image and a name. The image is taken from the photo library and that image is stored into my database.
After I retrieve the data from database, the data is shown in the tableview. When scrolling the tableview, the program stops. Why does this happen?
And when I update the selected row from table view it shows updated, but data is not updated in the database. Why does that happen?
I use code for update the data from database but the data are not updated into database .i execute the same query in sqlite database in executequery but they don't show error . if (sqlite3_open([path UTF8String], &compiledb)==SQLITE_OK) {
NSLog(@"Update data without image into Database");
const char *UpdateQueryinon="update tbl_AgeCalculation set fld_name =?,fld_Emailid =? where fld_name =? ";
(sqlite3_prepare_v2(compiledb, UpdateQueryinon, -1, &sql_stmt, NULL));
printf("\neror:%s",sqlite3_errmsg(compiledb));
if (sqlite3_prepare_v2(compiledb, UpdateQueryinon, -1, &sql_stmt, NULL)==SQLITE_OK) {
printf("Database to be worked");
sqlite3_bind_text(sql_stmt,1,[name_out UTF8String], -1, SQLITE_STATIC); sqlite3_bind_text(sql_stmt,开发者_C百科2,[emailid_out UTF8String], -1, SQLITE_STATIC); //sqlite3_bind_text(acs,3,[name UTF8String], -1, SQLITE_STATIC);
NSLog(@"Update completed"); } }
The usual problem in UITableViews making your app crash is a memory related, and it usualy lies in a method
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
In this method you are probably not releasing the cell and every time you scroll the table new cells are created in memory stacking until you run out of memory and the app crashes.
About your DB. I can't say much if you don't provide us with the code.
精彩评论