I have been reading this document but I am stuck on page 34. Could you please check if this code fragment leads to a memory leak?
Shouldn't there be
just after
?
Code:
- (id)initWithNibName:(NSString*)nibNamebundle:(NSBundle*)nibBundle
color:(UIColor*)color
{
self=[superinitWithNibName:nilbundle:nil];
if(self){
_color=[colorcopy];
self.navigationItem.prompt=@"Justacolor...";
UIBarButtonItem*anotherButton=[UIBarButtonIteminitWithTitle:@"Show"
style:UIBarButtonItemStylePlain
target:selfaction:@selector(showAnotherClicked:)];
self.navigationItem.rightBarButtonItem=anotherButton;
}
return self;
}
Shouldn't there be
Code:
[anotherButton release];
Code:
self.navigationItem.rightBarButtonItem=anotherButton;