The problem you are describing can be one of two things; you may oversubscribe an object, otherwise you may corrupt memory. If you damage memory - first of all, damage the first few bytes of an object, then this can easily occur as a result of a failure during the pool of the autorun pool (or any other message).
The fact that an accident occurs on the device, but not the simulator, also indicates a memory corruption. The architecture of the device [ARM] compared to the simulator [i386] is completely different, and there are some problems that may be in the game.
As a rule, he does not show himself so consistently.
First, place the back of the crash. This can help.
Secondly, are you making any raw malloc calls? Or filling buffers with data? The most common cause of such failures goes through the end of the buffer.
#0 0x31ac8bc8 in _cache_fill () #1 0x31acaf8e in lookUpMethod () #2 0x31ac8780 in _class_lookupMethodAndLoadCache () #3 0x31ac859a in objc_msgSendSuper_uncached () #4 0x328014f0 in -[__NSArrayReverseEnumerator dealloc] ()
(Above was added after the OP fixed the problem, but - for the archive)
This failure trace is the classic signature for memory corruption. Namely, the isa pointer - the first pointer to bytes in the object that points to the instance class - stomped. This usually happens when you overflow the memory buffer in the distribution in front of the object. If this is just a couple of overflow bytes, then the behavior between different platforms may differ, since malloc quanta is the actual size of the distributions (you request 90 bytes on one platform, and you can get 96. Another? 128) - - differ between platforms and even releases .
In particular, isa was released with a value that looked enough like a pointer to the runtime dereferencing the garbage value, and then tried to treat the resulting location as a class method table.
Each time you see a crash that is several frames deep in one of the objc_msgSend*() functions, this is most likely a memory corruption, and if so, there will almost always be a buffer overflow.
Since itβs easy to do, itβs still nice to do a test run with zombie detection to catch βsometimes itβs really just release cases.β