我正在使用带有ARC的xcode 4.2并且我一直收到此错误:
Fly(7258,0x7fff72157960) malloc: *** mmap(size=18446744073709522944) failed (error code=12)
*** error: can't allocate region
我发现这是导致问题的区域,但我看不出什么错误:
for (int i = 0; i < [lineArray count]; i++) {
if ([[lineArray objectAtIndex:i]length] >0) {
if ([[lineArray objectAtIndex:i]characterAtIndex:0]== 'v') {
if ([[lineArray objectAtIndex:i]characterAtIndex:1]== ' ') {
for (int b = 0; b <[[lineArray objectAtIndex:i]length]; b++) {
int charLoc;
if ([[lineArray objectAtIndex:i]characterAtIndex:b] ==' ') {
NSString *string = [[lineArray objectAtIndex:i] substringWithRange:NSMakeRange(charLoc+1, b-charLoc-1)];
charLoc = b;
}
}
}
}
}
}
非常感谢任何帮助, 本