这段代码内存泄漏
htmPath = [[NSBundle mainBundle] pathForResource:@"barcode" ofType:@"html"];
params = [[NSString alloc] initWithFormat:@"?data=%@",numberTextField.text];
fileURL = [NSURL URLWithString:[[[NSURL fileURLWithPath:htmPath] absoluteString] stringByAppendingString:params]];
[self.barView loadRequest:[NSURLRequest requestWithURL:fileURL]];
////htmpath,参数是字符串。
///fileurl 是 nsurl,在此我调用为结果附加两个字符串。 ///numberTextField.text 是将使用此 html 实现更多功能的文本字段。
htmPath = [[NSBundle mainBundle] pathForResource:@"barcode" ofType:@"html"];
params = [[NSString alloc] initWithFormat:@"?data=%@",numberTextField.text];
fileURL = [NSURL URLWithString:[[[NSURL fileURLWithPath:htmPath] absoluteString] stringByAppendingString:params]];
[self.barView loadRequest:[NSURLRequest requestWithURL:fileURL]];
////htmpath,params are strings.
///fileurl is nsurl and in this i m calling appending two strings for the result.
///numberTextField.text is the textfield that will use this html for further functionality.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已经分配了“params”但没有释放它。
您应该释放每个分配的对象。
you have allocated the "params" and did not released it.
you should release every allocated object.