【发布时间】:2011-12-07 11:51:57
【问题描述】:
我正在做一个登录和密码应用程序,如果我想将它连接到 SQLite DB,我复制了 SQLite 框架,导入它并将 db 文件添加到支持文件夹但它不起作用,请通过下面的代码检查,帮帮我
-(IBAction)homePage: (id)sender
{
post =[NSString stringWithFormat:@"loginname=%@ & password=%@",loginName.text,password.text];
NSString *hostStr = @"login.db";
//hostStr = [hostStr stringByAppendingString:post];
NSArray *doumentsPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDir=[doumentsPath objectAtIndex:0];
path =[documentDir stringByAppendingPathComponent:hostStr];
if([path isEqualToString:post]){
homePage *hvc = [[homePage alloc]initWithNibName: nil bundle: nil];
hvc.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:hvc animated: YES];
}
请告诉我解决这个问题的方法
【问题讨论】: