zoukankan      html  css  js  c++  java
  • SandBox沙盒

    沙盒:应用程序之间互相隔离

    应用程序只能访问自己本地的内容,不能访问其他app文件目录(越狱手机除外)

    为应用程序有自己的缓存和备份数据

    写法:NSString* homeDirectory = NSHomeDrirectory();

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

    1.获得沙盒文件中的文件

    项目中的资源文件,会打包到沙盒中,比如plist文件、图片资源(),或者加载xib中的文件

    如获得XXX.plist文件的路径

    NSBundle bundle = [NSBundle mainBundle];

    NSString* plistPath = [bundle pathForResource:@"XXX"ofType:"plist"];

    plistPath中包含了对应文件路径的字符串。

    2.加载xxx.xib对象

    NSBundle bundle = [NSBundle mainBundle];

    NSArray * objs = [bundle loadNibName:@"singleView"owner:nil options:nil];

    objs就包含了xib中所有的文件对象。

  • 相关阅读:
    jQuery:一些小练习
    jQuery
    JavaWeb:笔记(三)
    JavaWeb:笔记(二)
    JavaWeb:笔记(一)
    JavaWeb:文件的上传下载
    JavaWeb:Listener
    基于RRT的机器人自主探索建图
    OpenNI2安装
    g2o初始化一些
  • 原文地址:https://www.cnblogs.com/fanxinguu/p/4399856.html
Copyright © 2011-2022 走看看