2
當在xcode 4.2中運行分析時,我有警告「在初始化期間存儲到'圖像'的值永遠不會被讀取。任何人都可以幫我解決代碼有什麼問題?在其初始化過程中存儲爲'圖像'的值永遠不會被讀取
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;
謝謝。