If you get EXC_BAD_ACCESS
then you presumably also get a crash log, which will help you work out where the crash is. Probably dereferencing a pointer to memory which is not in play - for instance it's unclear where your aString
or url
variables come from. It's also not clear whether your app has multiple threads, in which case your local NSAutoreleasePool
might be releasing things you'd rather it didn't. All very hard to tell.
+1
A:
Graham Lee
2009-02-26 00:12:06
Yes there is a crash log. can you see it? I have no idea...http://www.wonderment.org/crashlog.txt
sky
2009-02-26 00:19:27
BTW why the hell does it crash the amount of time later?
sky
2009-02-26 00:21:39
It looks from your crash log like the NSTimer you've got has been set to nil somewhere. Make sure you're not releasing any timers while they're in use - particularly check that you're only using the timer on one thread/run loop.
Graham Lee
2009-02-26 08:06:48
Ah, should have woken up first. Not the timer itself, but the object which will receive the message when the timer fires.
Graham Lee
2009-02-26 08:16:36
+5
A:
Try running it in the iPhone Simulator with "Guard Malloc" (in Xcode's Run menu) enabled. That's a special setting designed to make hidden memory-access bugs cause immediate crashes rather than hiding for a while. (It will also make your app very slow and consume much more memory than normal, which is why it isn't always on.) It's not certain that it will help, but it might.
Brent Royal-Gordon
2009-02-26 00:16:46
you saved my butt. Guard Malloc threw the error without holding it for hours so that i was able to find where the problem caused. Thanks@
sky
2009-02-27 17:02:42