NSDictionary SQLite 映射

发布于 2024-10-02 07:27:09 字数 230 浏览 0 评论 0原文

我需要使用 NSDictionary 或 NSArray 映射我的数据库 ID。 我有一个表格视图。当我单击某个字段时 - 必须出现一个详细信息视图,其中包含有关记录的详细信息。 一切正常,当: 数据库表行 1-> 1 2-> 2 3-> 3

但是呃 数据库表行 1-> 1 30-> 2 31-> 3 不工作。

所以我需要将数据库记录和表视图相互链接。有什么建议吗?谢谢!

I need to map my database IDs with NSDictionary or NSArray.
I have a table view. When I'm clicking by some field - must apear a details view in which will be detailed information about record.
All work ok, when:
DB TableRow
1 -> 1
2 -> 2
3 -> 3

But whem
DB TableRow
1 -> 1
30 -> 2
31 -> 3
don't work.

So I need to link with each other database record and table view. Any suggestion? Thanx!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

做个ˇ局外人 2024-10-09 07:27:09
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    detailTableView = [[DetailsTableViewController alloc] initWithNibName: @"DetailsTableViewController" bundle:nil];

    //getting selected row
    NSUInteger row = [indexPath row]; 


    //initializing detailTableView with data to show details
    [detailTableView setWithObjectID: [[usersIDList objectAtIndex: row ] intValue] ];

    //show it
    [self.navigationController pushViewController: detailTableView animated:YES];
    [detailTableView release];  
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    detailTableView = [[DetailsTableViewController alloc] initWithNibName: @"DetailsTableViewController" bundle:nil];

    //getting selected row
    NSUInteger row = [indexPath row]; 


    //initializing detailTableView with data to show details
    [detailTableView setWithObjectID: [[usersIDList objectAtIndex: row ] intValue] ];

    //show it
    [self.navigationController pushViewController: detailTableView animated:YES];
    [detailTableView release];  
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文