我如何实现这个方法(见下文)?我是 Objective-C 的新手,我只是不太了解它。
From: http://lists.apple.com/archives/Webkitsdk-dev/2008/Apr/msg00027.html http://lists.apple.com/archives/Webkitsdk-dev/2008/Apr/msg00027.html
默认情况下数据库的配额为0;在将任何数据库存储在磁盘上之前,必须增加此配额。
WebKit 客户端应该实现 WebUIDelegate 方法- webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:
并在调用该方法时根据需要增加配额。该方法在 WebUIDelegatePrivate.h 中定义。它在上一个发布周期中添加得太晚,无法使其成为非私有标头。值得提交一个有关将此调用移至 WebUIDelegate.h 的错误,以便它成为官方 API 的一部分。
John
在您定义为 WebView 委托的任何类中,您都需要实现该方法,如下所示:
- (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier {
unsigned long long newQuotaBytes = 10 * 1024 * 1024;
[origin setQuota:newQuotaBytes];
// origin also responds to -usage method to return current size for all databases in this origin
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)