【发布时间】:2011-07-27 06:33:45
【问题描述】:
我在 tempstr = [tempstr substringToIndex... 我已经尝试了分配 tempStr 的所有可能组合, NSString *tempStr = @""; NSString *tempStr = [[NSString alloc] init]; (在循环结束时释放) 我尝试调整 NSString 的范围。没有。它产生3个泄漏 任何有关我可以尝试解决的问题的帮助将不胜感激。
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++
}
【问题讨论】:
标签: iphone memory-leaks nsstring substring