views:

16

answers:

1

When I try to get a h file that inherits from UITableViewController to conform to NSCoding, I can't switch views.

- (id) initWithCoder:(NSCoder*) coder
{
    [self init];
    return self;
}

Inserting the above code into the m file is what causes the problem. Why is that?

+2  A: 

Just calling [self init] can cause a lot of problems. You should override initWithCoder like that:

- (id)initWithCoder:(NSCoder*) coder
{
    self = [super initWithCoder: coder];
    if (self) {
        // Call a setup method
    }
    return self;
}
Max Seelemann