当在xcode 4.2中运行analyze时,我发出警告"在初始化期间存储到'image'的值永远不会被读取." 任何人都可以帮我解决代码有什么问题?
UIImage *image=[[[UIImage alloc] init]autorelease];
if (carousel==recipeCarousel) {
image = [recipeItems objectAtIndex:index];
} else {
image = [packItems objectAtIndex:index];
}
UIView *view = [[[UIImageView alloc] initWithImage:image] autorelease];
return view;
Run Code Online (Sandbox Code Playgroud)
谢谢.