xib自定义view crash

1.File's owner 不需要关联,只需关联根view的class

2.如果还是crash,则右击检查File's owner是否还有子view关联着它

PS:初始化方法示例:

+ (instancetype)initFromNib

{

    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"IDScreenShotView" owner:nil options:nil];

    IDScreenShotView *shotView = [nib objectAtIndex:0];

    return shotView;

}

posted @ 2017-06-30 13:44  ZLK0011  阅读(123)  评论(0编辑  收藏  举报