1

我正在使用带有 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;
                    }
                }
            }
        }
    }
}

任何帮助将不胜感激,本

4

0 回答 0