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]);
    }
  • 相关阅读:
    简介&目录
    Lucas 定理
    扩展欧几里得算法(exgcd)
    【做题记录】CF23B Party
    【做题记录】CF1375D Replace by MEX
    【做题记录】CF194B Square
    SPFA
    dijkstra
    CSP-J&S 2020 游记
    中国剩余定理(CRT)
  • 原文地址:https://www.cnblogs.com/bandy/p/2559781.html
Copyright © 2011-2022 走看看