-1

尝试运行我的测试类时,出现以下错误

架构 i386 的未定义符号:“_OBJC_CLASS_$_Client”,引用自:eFit2Tests.o 中的 objc-class-ref ld:未找到架构 i386 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v查看调用)

“_OBJC_CLASS_$_Client”,引用自:eFit2Tests.o 中的 objc-class-ref ld:未找到架构 i386 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

这是给出错误的构造函数的方法声明

导入“客户端.h”

@implementation 客户端

-(id)init
{
    if(self = [super init]) {

    firstName = @"Unknown First Name";
    lastName = @"Unknown Last Name";
    birthday = [NSDate date];

    // create weight array
    weight = [NSMutableArray arrayWithCapacity:1];

    workoutSkeletons = [NSMutableArray arrayWithCapacity:1];
}
return self;

}

这是给出错误的测试用例

#import "eFit2Tests.h"
#import "Set.h"
#import "Exercise.h"
#import "Workout.h"
#import "Client.h"
#import "Library.h"

@implementation eFit2Tests

- (void)testClientInit
{
Client* test = [[Client alloc] init];

/**
if([test fullName] != @"Unknown First Name Unknown Last Name") {
    STFail(@"Name not currectly initialized. (init (Client))");
}
if([test weight] != 0) {
    STFail(@"Weight not currectly initialized. (init (Client))");
}
 */

}

据我所知,我已经以相同的方式实现和测试了我的所有类,但是这是唯一给我一个错误的类。提前致谢。

4

1 回答 1

0

When I was checking the compiled sources I was looking at the wrong target. Oops...

于 2012-12-11T00:14:55.157 回答