문제

I am getting a memory error when attempting to run an action block, I have googled it a few times and I cannot work out what is wrong?

//[self newSquareAt:location];

[self runAction:[SKAction runBlock:^{
    [self newSquareAt:location];
}]];

The uncommented line of code works ok and no error or memory allocation problems

yet when i try to run the SKAction, i get the following error:

malloc: * mach_vm_map(size=1048576) failed (error code=3) * error: can't allocate region

please help

도움이 되었습니까?

해결책

That would be malloc being unable to allocate more memory. The way iOS works, I suspect you only get this message if you allocate lots of memory very quickly, because normally you would get a message that you are running out of memory.

Run your code under Instruments and find out where you are allocating tons of memory.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top