dies mein Snippet ist:Wie kann ich dieses Speicherleck beheben?
- (id) initWithFrame:(CGRect)frame andConfig:(PGParams*) params
{
for (int i=0; i<[conf.map count]; i++)
[conf.map replaceObjectAtIndex:i withObject:
[[NSString alloc] initWithFormat:@"%@&sito=%@",
[conf.map objectAtIndex:i], [params sito]]];
for (int i=0; i<[conf.orto count]; i++)
[conf.orto replaceObjectAtIndex:i withObject:
[[NSString alloc] initWithFormat:@"%@&sito=%@",
[conf.orto objectAtIndex:i], [params sito]]];
for (int i=0; i<[conf.mix count]; i++)
[conf.mix replaceObjectAtIndex:i withObject:
[[NSString alloc] initWithFormat:@"%@&sito=%@",
[conf.mix objectAtIndex:i], [params sito]]];
}
Kompilieren Sie diesen Code mit RUN_CLANG_STATIC_ANALYZER
Option (Property-> Build Optionen-> Ausführen Static Analyzer), zeigen sie mir ein Leck auf [[NSString alloc] ...
.
RUN_CLANG_STATIC_ANALYZER
diese Einstellung aktivieren wird Xcode verursacht den Clang statische Analyse-Tool auf qualifizierenden Quelldateien auszuführen. Dieses Tool unterstützt derzeit C- und Objective-C-Dateien. [RUN_CLANG_STATIC_ANALYZER]
Wie kann ich es beheben?
Vielen Dank im Voraus,
allberto
richtig! Danke, jetzt ist behoben! – elp