Lets say that I have a UIViewController which has an instance variable UIBarButtomItem *button which is not a property. In viewDidLoad I do:
button = [[UIBarButtonItem alloc] init...]
then
self.navigationController.leftBarButtonItem = button
Should I release the button object if I want to use it later in the same class? I have the same question about arrays (add an object to an array and use it later). I am confused because both the collections and UIViews retain the objects that are added to them
It depends how you are accessing them later. If you are accessing them by instance variable and not by way of the target collection then you should definitely release them.