Ios 如何使用uiscrollview滚动uiwebview
我有一个UIWebView而不是UIScrollView。我使用一些js文件来绘制一些类似于图形的线,当时间值发生变化时,这些线将更新 问题 当点离开屏幕时,我无法滚动 我是IOS开发新手,请帮助我Ios 如何使用uiscrollview滚动uiwebview,ios,cocoa-touch,iphone-developer-program,Ios,Cocoa Touch,Iphone Developer Program,我有一个UIWebView而不是UIScrollView。我使用一些js文件来绘制一些类似于图形的线,当时间值发生变化时,这些线将更新 问题 当点离开屏幕时,我无法滚动 我是IOS开发新手,请帮助我 提前感谢由于以下几个原因,数据库可能被锁定: 正在运行多个查询 多线程运行 多次打开数据库 检查代码,查看是否已关闭与数据库的连接sqlite3\u close()。一个好主意是在完成每个SQL语句后使用sqlite3\u finalize() 因此,尝试将所有的sqlite3\u open()
提前感谢由于以下几个原因,数据库可能被锁定:
- 正在运行多个查询
- 多线程运行
- 多次打开数据库
sqlite3\u close()
。一个好主意是在完成每个SQL语句后使用sqlite3\u finalize()
因此,尝试将所有的sqlite3\u open()
与sqlite3\u close()
匹配,并将sqlite3\u prepare()
(如果您正在使用它)与sqlite3\u finalize()匹配
After Completion the QUERY, You need to close transaction.
Here's the sample code for you...
// Get the documents directory
dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
// Build the path to the database file
databasePath = [[NSString alloc] initWithString: [docsDir stringByAppendingPathComponent: @"YOURDB.db"]];
const char *dbpath = [databasePath UTF8String];
if (sqlite3_open(dbpath, &DB) == SQLITE_OK)
{
NSString *query=[NSString stringWithFormat:@"insert into studentDetails (NAME,Email,adressL1,adressL2,phone,landline,department,DoB,fatherName) values (\"%@\",\"%@\",\"%@\",\"%@\",\"%@\",\"%@\",\"%@\",\"%@\",\"%@\")",
name.text,
email.text,
addressLine1.text,
addressLine2.text,
phone.text,
Landline.text,
Department.text,
DoB.text,
fname.text];
const char *insert_stmt = [insertSQL UTF8String];
sqlite3_prepare_v2(YOURDB, insert_stmt, -1, &statement, NULL);
if (sqlite3_step(statement) == SQLITE_DONE)
{
NSLog(@" Successfully added");
} else {
NSLog(@" Failed added");
NSLog(@"Error %s",sqlite3_errmsg(ExplorejaipurDB));
}
}
sqlite3_finalize(statement);
sqlite3_close(YOURDB);
}