我有一个带有2个不同发射图像的Images.xcasset:
LaunchImage和LaunchImage2。在启动图像源中,我选择启动图像。
然后,在AppDelegate里面的didFinishLaunchingWithOptions我有下面的代码:
splashView= [[UIImageView alloc] initWithFrame:([[UIScreen mainScreen] bounds])];
NSMutableArray *images = [[NSMutableArray alloc] init];
[images addObject:[UIImage imageNamed:@"LaunchImage"]];
[images addObject:[UIImage imageNamed:@"LaunchImage2"]];
[self.window addSubview:splashView];
[self.window bringSubviewToFront:splashView];
splashView.animationImages = images;
splashView.animationDuration = 2;
splashView.animationRepeatCount = 1;
[splashView startAnimating];
尝试检索LaunchImage2时,这会给我一个错误。我怀疑是因为它没有复制到捆绑包。它应该不应该复制xcasset中的所有图像?
我得到的错误如下:
*由于未捕获的异常终止应用&#39; NSInvalidArgumentException&#39;,原因:&#39; * - [__ NSArrayM insertObject:atIndex:]:对象不能为零&#39; < / p>