2011-01-12 164 views
0
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是字符串。內存泄漏此代碼

/// fileurl是nsurl,在此我調用追加兩個字符串的結果。 ///numberTextField.text是將使用此html進一步功能的文本字段。

回答

4

你已經分配了「params」並且沒有發佈它。

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

您應該釋放每個分配的對象。

[params release]; 
+0

我發佈了老闆 – pradeep