I wrote a small application using iPhone 3.x sdk. The app works well on device/simulator 3.x. But when I switch to device/simulator 4, it exit directly when I navigate among the tab pages. Here is the log form ~/Library/Logs/CrashReporter,
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000003
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Application Specific Information:
objc_msgSend() selector name: isKindOfClass:
iPhone Simulator 4.0 (211.1), iPhone OS 4.0.2 (iPhone/8A400a)
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x02502a97 objc_msgSend + 27
1 UIKit 0x00303f20 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 955
Could you please give me some help, thanks in advance.
Linkou Bian
Email/MSN: linkou.bian@gmail.com
I wrote this blog to help understand and debug EXC_BAD_ACCESS
Basically, you are dereferencing a pointer that is pointing to memory that isn’t allocated to your process. The main reasons that this could happen are
The things you should do to debug this:
Do a Build and Analyze. The reports of leaks are bad, but not related to this issue — you want to look for issues of too few retains
Turn on Zombies and run in the debugger. Now, none of your objects will be deallocated, but when they have a retain count 0, they will complain to the debugger if you use them.
There are other tips on the blog that are a little harder to explain