Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 内存泄漏此代码_Iphone_Ipod Touch - Fatal编程技术网

Iphone 内存泄漏此代码

Iphone 内存泄漏此代码,iphone,ipod-touch,Iphone,Ipod Touch,////htmpath,参数是字符串 ///fileurl是nsurl,在这里我调用为结果附加两个字符串。 ///numberTextField.text是将使用此html实现进一步功能的文本字段。您已分配了“参数”,但未将其释放 htmPath = [[NSBundle mainBundle] pathForResource:@"barcode" ofType:@"html"]; params = [[NSString alloc] initWithFormat:@"?data=%@",num

////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]];
您应该释放每个分配的对象

params = [[NSString alloc] initWithFormat:@"?data=%@",numberTextField.text];
您已经分配了“参数”,但没有释放它

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]];
您应该释放每个分配的对象

params = [[NSString alloc] initWithFormat:@"?data=%@",numberTextField.text];