zoukankan      html  css  js  c++  java
  • 通过字符串获取沙盒路径延展类

    #import <Foundation/Foundation.h>

    @interface NSString (sandBox)

    //  Document属性

    - (instancetype)appdendDocument;

    //  Cache属性

    - (instancetype)appdendCache;

    //  Temp属性

    - (instancetype)appdendTemp;

    @end

    #import "NSString+sandBox.h"

    @implementation NSString (sandBox)

    //   1.Document路径

    - (instancetype)appdendDocument {

        return [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:[self lastPathComponent]];

    }

    //   2.Cache路径

    - (instancetype)appdendCache {

        return [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:[self lastPathComponent]];

    }

    //   3.Temp路径

    - (instancetype)appdendTemp {

        return [NSTemporaryDirectory() stringByAppendingPathComponent:[self lastPathComponent]];

    }

    @end

  • 相关阅读:
    50
    49
    Windows编程之connect函数研究
    48
    C++创建窗口程序初步
    47
    46
    45
    计算机组成原理实验思路
    44(function pointer 2)
  • 原文地址:https://www.cnblogs.com/bao-yu/p/5254933.html
Copyright © 2011-2022 走看看