-3

我创建了一个自定义UIView并具有 LoginView.h 和 LoginView.m 和 LoginView.xib

当我在视图控制器中初始化它时,它给了我错误。

'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle

    -(id)initWithCoder:(NSCoder *)aDecoder{
    if(self = [super initWithCoder:aDecoder])
    {
        loginView=[[LoginView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width
                                                              , self.view.frame.size.height)];
        [self.view addSubview:loginView];
    }
    return self;
}
4

1 回答 1

3

I moved it to LoadDidView and it worked.

于 2013-04-27T05:16:05.170 回答