【发布时间】:2010-04-15 19:50:51
【问题描述】:
我正在关注 webview 的内存泄漏
initWebUILocalStorageSupport
MobileQuickLookLibrary()
这是我的代码,我不知道我错过了什么。
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10.0f];
[theRequest setHTTPMethod:@"POST"];
NSData *data = [self GenerateData];
if (data) {
[theRequest setHTTPBody:data];
}
[webView loadRequest:theRequest];
我希望我的问题很清楚。谢谢
编辑:为 GenerateData 添加代码
NSArray * results = [self.managedObjectContext executeFetchRequest:request error:&error];
if (!error) {
for (Items *item in results) {
}
NSString *theBodyString = [[CJSONSerializer serializer] serializeDictionary:theRequestDictionary];
theBodyData = [theBodyString dataUsingEncoding:NSUTF8StringEncoding];
}
return theBodyData;
【问题讨论】:
-
显示
GenerateData方法的代码。 (顺便说一句:Cocoa 中的方法名称通常应该以小写字母开头。)
标签: iphone memory-leaks uiwebview