Update
Version 3.2 with new sample for iOS 4.2 is available here.
I just pushed some changes to github, and make MapKitDragAndDrop version 3.1:

In version 3.0, when -initWithAnnotation:resuseIdentifier: called, I create annotationView based on the availability of MKAnnotationView’s isDraggable property. If MKAnnotationView can handle isDraggable, I will return the built-in MKPinAnnotationView; if not, I create DDAnnotationView instead, and let it handle the drag/drop functionality.
But here comes one problem: though document said isDraggable only available in iOS 4 and later, iOS 3.2 does has this property (but not enabled). As result, my
self.hasBuiltInDraggingSupport = [[MKAnnotationView class] instancesRespondToSelector:NSSelectorFromString(@"isDraggable")];
will return YES on iOS 3.2, and create the non-draggble MKPinAnnotationView back.
So one of the quickest solution is to check system version number instead of using -instancesRespondToSelect: to decide if we need to use DDAnnotationView:
self.hasBuiltInDraggingSupport = [[UIDevice currentDevice] systemVersion] compare:@"4.0" options:NSNumericSearch] != NSOrderedAscending;
That’s one of the changes in version 3.1.
As for synthesized by default, I previously enabled Objective-C 2.0 Non-fragile ABI for using the “synthesized by default” feature in MapKitDragAndDrop 3.0, turns out it a pain in the butt for many developers, even Apple removed these options in latest Xcode 4 preview.
And my thoughts on ivar changed: If you really want to get rid of ivar in Objective-C, use NSManagedObject. That’s more likely to be an ideal solution to you, even though you get other messy problems. Keep using ivar is not a bad idea after all, that’s how I told myself.
So, after considering, I changed my mind, no more synthesized by default in this version, and you are allowed to use either GCC or LLVM Compiler with it now.
Source code is licensed under MIT license. You can download it from github.
loading…