Setting UIBarItems's title: Why two lines of code?


#1

In the book, it asks us to set the UIBarItem’s title in ItemViewController’s init method as such:

- (id)init
{
    self = [super initWithStyle:UITableViewStyleGrouped];
    if (self) {
        UINavigationItem *n = [self navigationItem];

        [n setTitle: @"Homepwner"];
    }
    return self;
}

Stupid question, but is there a reason we do this in two lines of code as opposed to one, as such? :

- (id)init
{
    self = [super initWithStyle:UITableViewStyleGrouped];
    if (self) {
        [[self navigationItem] setTitle: @"Homepwner"];
    }
    return self;
}

I tested the one-line approach and it produces the same result.