iphone os 3 和iOS4的 CLLocation getDistanceFrom: 和 distanceFromLocation:

終於遇到第一次轉版本上的問題,其實內容都沒什麼大不了,只是method名轉了

google到了的各種解決方法中最喜歡這個:

http://0xced.blogspot.com/2010/09/cllocation-getdistancefrom-vs.html

main.m

#import 
Method getDistanceFrom = class_getInstanceMethod([CLLocation class], @selector(getDistanceFrom:));
class_addMethod([CLLocation class], @selector(distanceFromLocation:),
method_getImplementation(getDistanceFrom),
method_getTypeEncoding(getDistanceFrom));

好帥