如何解決這個內存泄漏......我甚至在最後發佈它,如在圖片中,但它仍然存在。在幾乎10-15的陳述中,它像使用給定的代碼一樣使用它......但是最終我釋放它。iphone:如何解決這個內存泄漏?
LoginResponse *response = [[LoginResponse alloc] initWithMessageString: messageString];
ServerMessage *ackMessage = [[ServerMessage alloc] initWithMessageToAck:response];
[[NSNotificationCenter defaultCenter] postNotificationName:@"SendMessageToServer" object:ackMessage];
[[NSNotificationCenter defaultCenter] postNotificationName:@"LoginResponseReceived" object:response];
你釋放字符串在'if'之外你創建它 – 2011-10-10 14:41:31