i’m NEW TO XCODE, working with mapkit and annotations, howver after building and running fine,
the application crashes on load. I ran the debugger and;
Stopped at Breakpoint 1 ‘mapView:viewForAnnotation: – Line 951’
continues after a few hit counts,
Program received signal: “EXC_BAD_ACCESS”.
I’ve read countless solutions something to do with alloc or releasing or something but have no idea where the problem is in my code.
EDIT: PROBLEM SOLVED.
Not a direct answer to your question, but i highly recommend you use a switch statement to replace the long “else if” code. Makes your code look much cleaner and your compiler can do optimizations.
http://en.wikipedia.org/wiki/Switch_statement
Edit;
After looking at the other comments (from Eiko), I have to agree that in this case you even want to remove this whole piece of code and replace it with some collection. The code contains too much duplications.