Why is release often called shortly after a local var is used instead of just autoreleasing
问题 I often see something like the following: UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@"Show" style:UIBarButtonItemStylePlain target:self action:@selector(refreshPropertyList:)]; self.navigationItem.rightBarButtonItem = anotherButton; [anotherButton release]; specifically where a local var, in this case 'anotherButton' is used and then later released. Is this exactly the same as autoreleasing it when it is alloc'ed and then making sure it is used before the method