NSBuilder mainBundle, app路径

来源:互联网 发布:定制家居拆单下料软件 编辑:程序博客网 时间:2024/05/22 15:39

    NSString *htmlPath = [[NSBundlemainBundle] pathForResource:@"index"ofType:@"html"inDirectory:@"SRC/main/smapleEnter"];


[NSBundle mainBundle]  是在 .app 里边  的,如果按照以上的路径寻找文件 的 话 ,在添加文件引用时:选择 "Create folder references for any added folders,;

选择 “create groups for any added folders”的话在app中根本找不着这文件;

AnnetPatientMng[929:c07] path:/Users/liaohua/Library/Application Support/iPhone Simulator/6.0/Applications/3EE17391-2B68-4962-BAE8-A373CBF66A54/AnnetPatientMng.app/SRC/main/smapleEnter/index.html

app在安装目录下有一个;在 /Users/liaohua/Library/Developer/Xcode/DerivedData/AntOA-fpuavgerkgsmwofzpwdvtqujfixn/Build/Products/Debug-iphonesimulator 下也有一个,平时 clean 时清的是这个目录下的,在安装目录那个run后才能更新。

"