关于XCode版本和sqlite3 的问题,,急,谢谢

指尖上的工程师 2012-03-07 03:21:20
小弟有两个问题:
一。之前在xcode4.2做的项目,今天更新到4.3之后,没法运行
错误报告:1.Applications are expected to have a root view controller at the end of application launch
2.-[NSConcreteMutableData getCharacters:range:]: unrecognized selector sent to instance 0x8644340
总结一下:就是旧版本到新版本需要又什么改动啊。能给个链接或者详细的demo(magicadong932056@sina。com)


二。之前有个项目。在XCode模拟器上运行是OK的。但是在iPod touch上运行时就报错。其中用到了数据库,
- (int)selectURL:(NSString *)urlString {
NSString *string = [NSString stringWithFormat:@"%@",urlString];
NSString *selectSQL = [NSString stringWithFormat:@"SELECT ID FROM %@ WHERE URL='%@'",FILEID_URL_TABLE,string];
sqlite3_stmt *statment = NULL;
if (sqlite3_prepare_v2(dataBase,[selectSQL UTF8String],-1, &statment, NULL) == SQLITE_OK)
{
while (sqlite3_step(statment) == SQLITE_ROW) {这句报错EXC_BAD_ACCESS
int id = sqlite3_column_int(statment, 0);
NSLog(@" exist in SQL %@",string);
return id;
}

}
NSLog(@" doesn't in SQL %@",string);
return -1;
}
想问一下,这是为什么 谢谢
...全文
638 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
相奇 2012-03-08
  • 打赏
  • 举报
回复
1.Applications are expected to have a root view controller at the end of application launch


查看下,你的ROOT viewController是不是设置了。。。就是你页面对应的第一个ViewController,对应window窗口的显示页面。或者委托delegate方法里有没有写明

2NSConcreteMutableData getCharacters:range

是说这个方法有变更,找不到


3while (sqlite3_step(statment) == SQLITE_ROW)

我数据库接触的少, 是不是statement 你忘记给 赋值了?一直都是nil的?

EXC_BAD_ACCESS:常见都是释放过多导致
  • 打赏
  • 举报
回复
2.-[NSConcreteMutableData getCharacters:range:]: unrecognized selector sent to instance 0x8644340
总结一下:就是旧版本到新版本需要又什么改动啊。能给个链接或者详细的demo(magicadong932056@sina。com)

这个得你自己去查api
  • 打赏
  • 举报
回复
sqlite3_stmt *statment = NULL;为啥==NULL。。。。

29,027

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧