最新の SDK を使用して iOS 5 以降のアプリを開発しています。
TopMenuViewカスタム XIB を使用してカスタム UIView ( ) を作成しました。Interface Builder で、この XIB でUIViewクラスを に変更しましたTopMenuView。私は何も設定していませんFile's Owner。
私TopMenuView.mが持っている:
- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self)
    {
        NSLog(@"init with coder: %d", counter);
        counter++;
        // Add custom XIB
        NSArray *topMenuView = [[NSBundle mainBundle] loadNibNamed:@"TopMenuView"
                                                             owner:nil
                                                           options:nil];
        UIView *nv = [topMenuView objectAtIndex:0];
        [self addSubview:nv];
    }
    return self;
}
Interface Builder を使用して、 を に追加UIViewし、このクラスを にUIViewController変更しました。UIViewTopMenuView
しかし、アプリを実行すると、次のログ メッセージが 4251 回表示されます。
2013-10-13 20:49:34.078 MyProject[470:c07] init with coder: 0
そして、私はEXC_BAD_ACCESSここにいます:
NSArray *topMenuView = [[NSBundle mainBundle] loadNibNamed:@"TopMenuView"
                                                             owner:nil
                                                           options:nil];

