"
But when I install into OS2.2.1 device, I got the errors below:
<Program received signal: “EXC_BAD_ACCESS”.>
Stopped at: color_ = ccWHITE;
Can anyone have same experience can share? thanks!"
An easier way to see what, or where, this is happening for you is to get a backtrace. YOu can see that in the pop-up but also in the console when stopped at the error, type BT to see what is up.
That said this error seems like it is merely masking the problem of corruption elsewhere. ccWhite is hard coded so it should not be a problem ( it cant be autoreleased) and therefore assignment should be valid at that point, unless the entire memory is mushed up.
I need we need to take a step back here.
1) MapKit is not available on OS 2.2.1,
2) that will generate a link error when building for 3.0.x
3) you are getting around the link error by forcing weak linking in xCode when deploying on OS 2.2.x
4) however when you run it on the OS 2.2.1 device it, quite understandably, crashes out. It is trying to call code it doesnt have on the system. Weak linking helps you get past linking issues, it cant magically make the program run. Bascially it is used to link against frameworks which are not available at link time, but are at run time ( plugins perhaps). It is fairly rare to use this.
Bottom line you cant run a application which needs an OS 3.0 framework ( mapkit) on OS 2.2.x because it isnt there.