未定义的建筑符号

时间:2011-07-01 09:51:34

标签: iphone objective-c ipad xcode4

如何解决以下问题:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_RKObjectLoaderTTModel", referenced from:
      objc-class-ref in MyGroupViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

我的代码是:

- (void)createModel {
    RKObjectLoader* objectLoader = [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/groups.json" delegate:nil];
    self.model = [RKObjectLoaderTTModel modelWithObjectLoader:objectLoader];
    [super createModel];
}


- (void)didLoadModel:(BOOL)firstTime {
    [super didLoadModel:firstTime];

    if ([self.model isKindOfClass:[RKObjectLoaderTTModel class]]) {
        RKObjectLoaderTTModel* model = (RKObjectLoaderTTModel*) self.model;
        NSMutableArray* items = [NSMutableArray arrayWithCapacity:[model.objects count]];

        TTListDataSource *dataSource = [[[TTListDataSource alloc] init] autorelease];

        for (Group* group in model.objects) {
            NSString* imageURL = group.creator.url;
            TTTableImageItem* avatar = [TTTableImageItem itemWithText:@" "
                                                             imageURL:imageURL];

            TTTableItem *item = 
            [TTTableSubtitleItem 
             itemWithText:group.name
             subtitle:[NSString stringWithFormat:@"%@ members %@ topics ", group.members_count , group.topics_count]
             URL:@""];

            [items addObject:item];
            [items addObject:avatar];
        }

        dataSource.items = items;
        //dataSource.model = model;
        self.dataSource = dataSource;
    }
}

请建议。

2 个答案:

答案 0 :(得分:0)

我认为你缺少一个使用“RKObjectLoaderTTModel”的框架。查看此viewController并添加缺少的框架,我认为它将解决您的问题。

这只是我从上面的错误中想到的。希望这有帮助。

答案 1 :(得分:0)

在“构建阶段”下的Xcode的目标设置中是“与库的链接二进制”部分,确保您的库列在那里。