iPhone 3.0 shipping, that means the book is good to go!
Jun 17, 2009 by Bill Dudney
With Apple shipping the iPhone 3.0 update the NDA is officially gone and we were able to ship an updated copy of the book. There are a ton of changes for 3.0 but here are some of the highlights.
- Core Data
- Map Kit
- iPod Library Access
- AFFoundation
- Core Audio
- Updates throughout for 3.0 API changes
The book's page over at pragprog.com has some new excerpts too in case you are still on the fence about purchasing you can see a bunch of the new stuff in these new excerpts.
We are only a few weeks (6 to 8) away from the dead tree version now, boy I can't wait!




Congratulations. This had to have been quite an undertaking, given the breadth of material covered by the book.
I just wanted to say that the peer-to-peer networking chapter, particularly the detailed section on GameKit, was worth the purchase alone for me. I missed the session on that at WWDC due to a conflict, so this helps me to fill in the blanks.
Posted by Brad Larson on June 21, 2009 at 05:59 PM MDT #
The book looks great I am ordering.
On the Mapkit stuff. One thing I found tricky when I was learning the customization of the pin views. Most samples had derived pinannotation classes and would locally cast to the custom annotation in the viewForAnnotation. It was not clear that this function was automatically called for annotations added by the system like the userLocation.
Your code somewhat protects against this but it is not explained why this test is done. You could read it that you did that to just put different info in for the userview. Some of the google examples don't do this at all leading to crashes. Looking at sample code a lot of people don't understand this.
The problem for me was my assumption that the assignment would fail to null as C++ casts do for different classes.
So for a cast to custom MKAnnotation
MKMyAnnotation *myAnn = annotation;
if(myAnn != nil) {
// this is custom pin
This doesn't work. You need to do
if(annotation != mapView.userLocation) {
MKMyAnnotation *myAnn = annotation;
if(myAnn != nil) {
...
Posted by Jeff on August 19, 2009 at 12:14 PM MDT #
Thanks for the kind words Jeff.
My code does indeed protect against the problem in this simple case (2 annotations types) but you are correct that in a more complex example you'd want to be more explicit.
In ObjC casts are like C casts, they do nothing to convert. All that happens is its a new way to look at the same spot in memory.
There are a hundred ways to skin this cat. To start with you could simply look if the class is what you expect via the isSubclassOfClass: method.
Good luck!
Posted by Bill Dudney on August 19, 2009 at 12:20 PM MDT #