我有一个sqlite数据库。我是使用SELECT
命令从数据库读取到表。
我想在tableView和数据库中添加一个包含少量字段的新单元格。
这是我的代码(不起作用):
<{1>}中的- 准备下一个视图
RootViewController
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic -- create and push a new view controller
SQLiteAppDelegate *appDelegate = (SQLiteAppDelegate *)[[UIApplication sharedApplication] delegate];
usersSale *us = (usersSale *)[appDelegate.usersSale1 objectAtIndex:indexPath.row];
if(self.detailView == nil) {
DetailViewController *viewController = [[DetailView alloc] initWithNibName:@"DetailViewViewController" bundle:nil];
self.animalView = viewController;
[viewController release];
}
[self.navigationController pushViewController:self.animalView animated:YES];
self.detailView.title = [us storeName];
self.detailView.txtProduct.text = [us saleSpecificProduct];
NSString *inStr = [NSString stringWithFormat:@"%d",us.saleMaxPrice];
self.detailView.txtPrice.text = inStr; //[us saleMaxPrice];
self.detailView.txtSaleNotes.text = [us saleNotes];
self.detailView.txtSaleCatagory.text = [us saleCatagory];
self.detailView.txtUserArrivalTime.text = [us userArrivalTime];
self.detailView.txtPublishDate.text = [us publishDate];
}
中的:
DetailViewViewController