哪个调用是正确的?似乎两个电话都有相同的结果。
UIImage *img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"]];
或者
UIImage *img = [[UIImage alloc] imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"]];