Error on CLLocation subclassing

时光总嘲笑我的痴心妄想 提交于 2020-01-16 00:46:07

问题


I'm trying to make a new CLLocation subclass. This is the skeleton:

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

@interface JFLocation : CLLocation {

}

@end


#import "JFLocation.h"


@implementation JFLocation

@end

When I build the class I'm getting this errors:

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

Any Idea?? Thank you!!


回答1:


You should add CoreLocation.framework to the frameworks used by the project.

Right click on "Frameworks" in the Xcode project. Click Add > Existing Frameworks...

By default the path should be:

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


来源:https://stackoverflow.com/questions/1314582/error-on-cllocation-subclassing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!