app动态替换启动页遇到的各种问题

我处理的逻辑,当app第一次启动时,默认加载launchFile默认的图片,进入app,异步线程下载网络图片到本地(假装一下)

NSString *path = @"http://b.hiphotos.baidu.com/image/pic/item/279759ee3d6d55fb733229e267224f4a21a4dd7a.jpg";

NSURL *url = [NSURL URLWithString:path];

NSData *fileData = [NSData dataWithContentsOfURL:url];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

NSString *documentsDirectory = [paths objectAtIndex:0];

NSFileManager *fileManager = [NSFileManager defaultManager];

//将图片存储到本地documents

[fileManager createFileAtPath:[documentsDirectory stringByAppendingString:@"/splash.png"] contents:fileData attributes:nil];

NSLog(@"infoDictionary = %@",infoDictionary);


想要替换启动页的图片,在app info.plist添加了Launch image (iPhone) 键,值../Documents/splash.png,选中值,右键show rowkays/values 点击  ,--键变成了UILaunchImageFile~iphone

多次测试发现,

使用launchFile为启动页时,在ios沙盒,或者ios操作系统中留存了启动图,,当我进入沙盒看见了图片.ktx格式,我现在准备删掉启动图,

使用launchImages 为启动页时,app沙盒里并没有看见启动图。

启动页launchFile 优先级比launchImage高,

还是木有解决掉

你可能感兴趣的:(app动态替换启动页遇到的各种问题)