J'ai eu une fuite de mémoire à la ligne tempstr = [tempstr substringToIndex ... Ive essayé toutes les combinaisons possibles d'allocation tempStr, NSString * tempStr = @ ""; NSString * tempStr = [[NSString alloc] init]; (avec une version à la fin de la boucle) ive essayé d'ajuster la portée de la NSString. RIEN. Sa production 3 fuites Toute aide sur ce que je peux essayer de le réparer serait très appréciée.substringToString produisant une fuite
while(x < [arr1 count]){
//NSLog(@"%@", [arr1 objectAtIndex:x]);
if([[arr1 objectAtIndex:x] rangeOfString:@".com"].location != NSNotFound)
{
//NSLog(@"%@", [arr1 objectAtIndex:x]);
tempStr = [[arr1 objectAtIndex:x] substringFromIndex:[[arr1 objectAtIndex:x] rangeOfString:@"http://"].location];
tempStr = [tempStr substringToIndex:tempStr.length - 1];
[arr1 replaceObjectAtIndex:x withObject:tempStr];
//NSLog(@"%@", [arr1 objectAtIndex:x]);
}
..... more code....
x++
}
Je travaillais sous l'hypothèse que mon pool de autorelease n'est pas configuré correctement. Pour autant que je sache, cela devrait être fait automatiquement pour moi ... suis-je incorrect? – Riley
'NSString * tempStr = [[arr1 objectAtIndex: x] substringFromIndex: [[arr1 objetAtIndex: x] plageOfString: @" http: // "] .location]; TempStr = [tempStr substringToIndex: tempStr.length - 1]; [arr1 replaceObjectAtIndex: x withObject: tempStr]; 'fuit également – Riley