【发布时间】:2012-01-10 01:33:14
【问题描述】:
这是来自 Apple 的一些 example code 中的一个类的方法。为什么将此方法定义为静态 C 方法而不是 Objective C 类方法或类方法?在使用它的上下文中,我认为它需要尽可能高性能。这是为什么?这是声明方法的最高效方式吗?
static BOOL lineIntersectsRect(MKMapPoint p0, MKMapPoint p1, MKMapRect r)
{
//Do stuff
return MKMapRectIntersectsRect(r, r2);
}
【问题讨论】:
标签: objective-c c performance methods static