Apple Macho Linker错误Xcode

Ter*_*son 1 xcode linker class mach-o objective-c

您好我正在创建一个动态表视图,我正在尝试从存储在其他文件中的方法上传信息.当我尝试测试我是否收到信息时,我得到了Macho Linker Error

架构i386的未定义符号:"_ OBJC_CLASS _ $ _ FlickrFetcher",引自:MyTableViewController.o中的objc-class-ref ld:未找到架构i386的符号

这是我添加的代码导致了问题.

FlickerFetcher.h这有我的tableViewController调用topPlaces的方法

@interface FlickrFetcher : NSObject

+ (NSArray *)topPlaces;
+ (NSArray *)photosInPlace:(NSDictionary *)place maxResults:(int)maxResults;
+ (NSURL *)urlForPhoto:(NSDictionary *)photo format:(FlickrPhotoFormat)format;

@end
Run Code Online (Sandbox Code Playgroud)

TableViewController文件.我觉得这个问题发生在setter Brain我懒得实例化它因为代码在我添加它之前工作正常,NSlog返回NUll因为没有对象但是它正在工作,然后当我添加setter来实现它我得到了Macho Linker错误.

#import "MyTableViewController.h"
#import "FlickrFetcher.h"

@interface MyTableViewController ()
@property (nonatomic, strong) FlickrFetcher* brain;
@end

@implementation MyTableViewController
@synthesize brain= _brain;

 //Error occured after I added this setter
-(FlickrFetcher*) brain
  {
  if (!_brain) _brain= [[FlickrFetcher alloc] init];
   return _brain;
}


- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
    // Custom initialization
    }
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];


//use a class method call since this is a class method
NSLog(@"Class = %@", [self.brain class]);
NSLog(@"Array = %@", [[self.brain class] topPlaces]);

}
Run Code Online (Sandbox Code Playgroud)

Ter*_*son 6

我发现错误,结果是文件FlickrFetcher没有编译或在编译列表中,我通过单击导航菜单中的项目,在目标下单击我的应用程序,进入构建阶段然后添加文件来修复此问题在编译源中.希望能帮助任何人解决这个问题