我在NSString上有很多泄漏。我使用appendformat將字符串附加到它。NSString泄漏附加格式
下面的代碼:
NSString *textedetails = [[NSMutableString alloc] init];
if([dico objectForKey:@"alertSerie"] != nil)
{[textedetails appendFormat:@"Numéro de Série: %@ \n",[dico objectForKey:@"alertSerie"]];}
if([dico objectForKey:@"alertDate"] != nil)
{[textedetails appendFormat:@"Date de mise en service: %@ \n",[dico objectForKey:@"alertDate"]];}
if([dico objectForKey:@"alertCli"] != nil)
{[textedetails appendFormat:@"Nom du client associé: %@ \n",[dico objectForKey:@"alertCli"]];}
... //我把textdetails成的UITextField和... [textedetails發佈];
該代碼給我泄漏在第一和上面的代碼的最後一行...
和泄漏的PRINTSCREEN是HERE !!!
非常感謝幫助我!
運行分析您的代碼。 – zaph
完成後釋放字符串。 –
我想你的問題已經被低估了,因爲你沒有直接將代碼放入問題中和/或因爲它是一段很長的代碼,沒有明顯的努力來隔離問題。 – Codo