为什么我无法获得此SQLite代码来为我的详细信息视图加载正确的数据? [英] Why can't I get this SQLite code to load the proper data for my detail view?

查看:56
本文介绍了为什么我无法获得此SQLite代码来为我的详细信息视图加载正确的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

- (void) hydrateDetailViewData {
//if detail view is hydrated then do not get it from database
if(isDetailViewHydrated) return;

if(detailStmt == nil) {
    const char *sql = "select snapTitle, snapDesc from Snap where snapID =?";
    if(sqlite3_prepare_v2(database, sql, -1, &detailStmt, NULL) != SQLITE_OK)
        NSAssert1(0, @"Error while creating detail view statement. '%s'", sqlite3_errmsg(database));
    NSLog(@"SQLite= %d", sqlite3_step(detailStmt)); 

}

if (sqlite3_step(detailStmt) == SQLITE_ROW)//execute sql statement on database, and make sure it executed properly.
{
    self.snapDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(detailStmt, 1)];
}   

看着上面的代码,有人可以告诉我怎么了,为什么我无法将其加载到我的detailview上?我基本上遵循了iPhone sdk上的教程.不知道为什么会出错.

looking at the above code, can someone tell me what's wrong and why is it that i can't get it to load on my detailview?i basically followed the tutorial on iphone sdk article..but yet i am having this don't know why error.

如果你们需要看一下,我什至可以发送我的项目.

i can even send my project if u guys need to take a look.

错误消息:

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] was unable to load a nib named "DetailView"'
2010-03-15 16:35:55.202 Snap2Play[58213:20b]

推荐答案

您的错误和您的问题不匹配,就我所知,该错误与上述代码无关.

Your error and your problem don't match, the error is nothing to do with the above code as far as I can see.

错误与调用

The error is to do with a call to loadViewFromNibNamed:bundle: - I'm guessing that you don't have a xib file in your project called DetailView.xib

这篇关于为什么我无法获得此SQLite代码来为我的详细信息视图加载正确的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆