Can I autorelease the following?
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:backButton] autorelease];
it works and removes an Analyzer warning I was getting. if not, how would I go about releasing it correctly.
thanks for any help
This is correct.
The leftBarButtonItem is a property that retains the UIBarButtonItem, so yes it is a good approach.
Without the autorelease message it will cause a memory leak.