CLLocation子类化时出错

时间:2009-08-21 23:14:04

标签: iphone objective-c class iphone-sdk-3.0 subclass

我正在尝试创建一个新的CLLocation子类。这是骨架:

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@interface JFLocation : CLLocation {

}

@end


#import "JFLocation.h"


@implementation JFLocation

@end

当我构建课程时,我遇到了这个错误:

Undefined symbols:
  ".objc_class_name_CLLocation", referenced from:
      .objc_class_name_JFLocation in JFLocation.o
ld: symbol(s) not found

任何想法?谢谢!!

1 个答案:

答案 0 :(得分:1)

您应该将CoreLocation.framework添加到项目使用的框架中。

右键单击Xco​​de项目中的“Frameworks”。点击添加>现有框架...

默认情况下,路径应为:

/Developer/Platforms/iPhoneOS.plarform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/CoreLocation.framework