So my question is … who’s the delegate of MKReverseGeocoder?
It seems like there are two ways (hell, probably more) to go here…
It might be reasonable to have each MapPoint own a MKReverseGeocode object, and if the user wants the subtitle to be city and state to then have a MapPoint instance method that gets the ball rolling on an as-needed basis. To the best of my understanding, MapPoint would then have to be the delegate class for MKReverseGeocoder.
Also, you could have you AppDelegate be the delegate class for MKReverseGeocoder and make it responsible for setting the subtitle of each annotation of the map view. It could set the subtitles as you build the annotation object, or after the object has been added to the array (as Joe whets our appetite earlier…)
I am curious to know which approach would be used more frequently, and why. Would nearly all programmers stay away from option one because it makes MapPoint less re-usable? Or maybe because your Model objects aren’t suppose to be delegates? I don’t know.
At this point, the book doesn’t provide me any theory (I know, it’s super boring!) to understand why I should choose one over the other. So I figured I’d open up that can of worms!
MKReverseGeocoder could be a really large object (unbeknownst to me), and so creating a new one for each of my MapPoints in the annotations array may be ludicrous. Or it could be that I can’t fire up several reverse look ups without bringing my app to it’s knees. I was hoping to get some insight into how to think and avoid such pitfalls as I tackle these tasks.
I think the challenge I’ll issue myself is to code both of them up and see if I can tell any obvious benefits or drawbacks. While I work on that, I’d be very interested to hear how everyone weighs in.