Iphone 内存泄漏此代码
////htmpath,参数是字符串 ///fileurl是nsurl,在这里我调用为结果附加两个字符串。 ///numberTextField.text是将使用此html实现进一步功能的文本字段。您已分配了“参数”,但未将其释放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 = [[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];