DetailViewController.h:@property(weak, nonatomic) IBOutlet UIImageView *recipeImage;
DetailViewController.mで
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.recipeTitle.text = rec.title;
self.recipeDetail.text = rec.details;
NSString *fileName = [NSString stringWithFormat: @"%@/%@", [[NSBundle mainBundle] resourcePath], rec.image];
UIImage *tmp = [[UIImage alloc] initWithContentsOfFile: fileName];
self.recipeImage.image = tmp;
NSLog(@"%@", rec.image);
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
recipeTitle = nil;
recipeDetail = nil;
recipeImage = nil;
rec = nil;
}
何らかの理由で、recipeImageUIImageViewIBOutletがメモリリークを引き起こしています