开发者

Redefine ios method

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜