- (void)viewDidLoad //In this scenario it only gets called once, but in other bits of code with same property initialisation it might be called more than once
{
deleteButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:@selector(deleteModelTapped:)]; //Is this leaking?
self.deleteButton.image = [UIImage imageNamed:[Configuration getDeleteIconName]];
}
@property (nonatomic, retain) IBOutlet UIBarButtonItem *deleteButton;
- (void)dealloc
{
[deleteButton release];
[super dealloc];
}
– (void)viewDidLoad //In this scenario it only gets called once, but in other bits
Share
nop, but write like this maybe better
the setProperty expand may like this
the “leak” maybe use “[UIImage imageNamed:]”; 🙂