Quick question about UINavigationItem


I have a quick question about the UINavigationItem class, specifically when it’s implemented in the BNRItemsViewController init method.

In the book you assign the UIViewController property ‘navigationItem’ to a UINavigationItem object, but you don’t actually allocate and initialise the UINavigationItem object - you just assign it to the property.

Can someone explain why you don’t have to create the object?


Hi man, the UINavigationItem is a property of UIViewcontroller, you can access it anytime you want without allocate or init.

// Created on-demand so that a view controller may customize its navigation appearance.