Infinite loop when overriding initWithCoder

前端 未结 5 841
臣服心动
臣服心动 2020-12-28 08:54

I have a UIViewController with some controllers and some views. Two of these views (Grid Cell) are other nibs. I\'ve got outlets from the Grid Cells to File\'s

5条回答
  •  囚心锁ツ
    2020-12-28 09:43

    I had the same issue when I'm trying to override initWithsomething method, we need

    -(id)initWithsomething:(Something *)something
    {
        if (self = [super initWithsomething:something]) {
           // do stuff here ... 
        }
    
        return self; 
    }
    

    instead

    -(id)initWithsomething:(Something *)something
    {
        if (self = [super init]) {
           // do stuff here ... 
        }
    
        return self;
    }
    

提交回复
热议问题