开发者

Redefine ios method

开发者 https://www.devze.com 2023-03-13 04:12 出处:网络
Hi I need the redefine an ios method (CLLocationCoordinate2DMake) with this code: static inline CLLocationCoordinate2D CLLocationCoordinate2DInlineMake开发者_JAVA百科(CLLocationDegrees latitude, CLLo

Hi I need the redefine an ios method (CLLocationCoordinate2DMake) with this code:

static inline CLLocationCoordinate2D CLLocationCoordinate2DInlineMake开发者_JAVA百科(CLLocationDegrees latitude, CLLocationDegrees longitude)
{
    CLLocationCoordinate2D coord;
    coord.latitude = latitude;
    coord.longitude = longitude;
    return coord;
}

#define CLLocationCoordinate2DMake CLLocationCoordinate2DInlineMake

But I don't know where put this code...

Thanks


For the record, I assume you're working from:

http://www.cocoanetics.com/2010/09/backwards-compatibility-if-apple-starts-polishing/

Either way, you just need to stick it in a header which you'll import wherever you intend to use CLLocationCoordinate2DMake. You could even include it in you .pch file if you really wanted to, which would make it available everywhere with no further effort on your part.

0

精彩评论

暂无评论...
验证码 换一张
取 消