• 沙盒文件夹


            //应用程序主文件夹(沙盒文件夹 sandbox)

            NSString *homePath = NSHomeDirectory();

            NSLog(@"%@",homePath);

            //应用程序主资源包的路径,应用程序中的资源,在应用程序第一次执行中,会自己主动复制到应用程序的主资源包中

            NSString *appPath = [[NSBundle mainBundle]bundlePath];

            NSLog(@"%@",appPath);

            //读取家文件夹中Documents文件夹

            NSString *docuPath = [homePath stringByAppendingString:@"/Documents"];

            NSLog(@"%@",docuPath);

            //获取temp文件夹

            NSString *tmp = NSTemporaryDirectory();

            NSLog(@"%@",tmp);

            //获取主资源包资源数据(图片资源在黄色文件夹中的获取方法)

            NSString *picPath = [[NSBundle mainBundle]pathForResource:@"17_1" ofType:@"jpg"];

            NSString *picPath2 = [[NSBundle mainBundle]pathForResource:@"17_2" ofType:@"jpg" inDirectory:@"images"];

            NSString *picPath3 = [[NSBundle mainBundle]pathForResource:@"/images/17_2.jpg" ofType:nil inDirectory:nil];

  • 相关阅读:
    linux系统cpu和内存占用率
    虚拟机网卡设置
    C语言中打印返回值
    MQTT_DEMO
    MQTT-C-UDP_PUB
    MQTT-C-PUB
    结构体指针用法
    linux系统如何操作隐藏文件
    mqtt学习笔记
    XML文件的读取----cElementTree
  • 原文地址:https://www.cnblogs.com/zhchoutai/p/8555333.html
Copyright © 2020-2023  润新知