哪個調用是正確的?似乎這兩個調用都有相同的結果。iOS:初始化UIImage
UIImage *img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"]];
或
UIImage *img = [[UIImage alloc] imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"]];
+1我誤讀了第二個(這不是一件聰明的事) – MByD