iOS Undefined symbols for architecture i386:

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013163834/article/details/41892885

 
 
出现如下错误:

Undefined symbols for architecture i386:

  "_OBJC_CLASS_$_PlayerControlsBar", referenced from:

      objc-class-ref in PlayControl1.o

ld: symbol(s) not found for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)



一般都是去Atarget -->Build Phases-->Complies Sources -->去看当前类的。m文件添加了没,或者少添加了什么类库

但有时会因为:

自己手写,或者复制别人代码时 在当前类的上面写个新类时,(由于疏忽)@interface 和@implementation有个少写 它也会报如上错误,原因你懂的


#import "PlayControl1.h"

#import "Button1.h"


@interface PlayerControlsBar : UIView


@property (nonatomic, strong) UIColor *color;


@end


//@implementation PlayerControlsBar

//

//@end


@implementation PlayControl1

{

    Button1 *btn1;

    Button1 *btn2;

    Button1 *btn3;

    Button1 *btn4;

    Button1 *btn5;

    PlayerControlsBar *_topBar;

    PlayerControlsBar *_bottomBar;

}


- (id)initWithFrame:(CGRect)frame

{

    self = [super init];

    if (self)

    {

        [self initWithUI];

    }

    return self;

}




猜你喜欢

转载自blog.csdn.net/u013163834/article/details/41892885