zoukankan      html  css  js  c++  java
  • IPA PNG图片转换

    - (void)loadAllBundleImage
    {
        NSArray * imagesPath = [NSBundle pathsForResourcesOfType:@"png" inDirectory:[[NSBundle mainBundle]bundlePath]];
        for (NSString * a in imagesPath) {
            NSData * idata =UIImagePNGRepresentation([UIImage imageWithContentsOfFile:a]);
            [self writeApplicationData: idata toFile: [a lastPathComponent]];
        }
    }
    - (BOOL)writeApplicationData:(NSData *)data toFile:(NSString *)fileName 
    {
        NSArray *paths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        if (!documentsDirectory) {
            NSLog(@"Documents directory not found!");
            return NO;
        }
        NSString *appFile = [documentsDirectory stringByAppendingPathComponent:fileName];
        return ([data writeToFile:appFile atomically:YES]);
    }
  • 相关阅读:
    Python获取Linux的家目录
    Python 批量安装包、查看当前程序依赖的包
    获取linux目录下最新的文件
    Linux破解navicat
    Linux添加PATH
    Linux下文件分析 | 命令行
    ROP | 蒸米 -x86
    Jarvis OJ | guess
    杂项入门
    Whale ctf | misc
  • 原文地址:https://www.cnblogs.com/bandy/p/2559781.html
Copyright © 2011-2022 走看看