ios 项目发布到虚拟器上的 项目的路径

1. 项目的根路径:

[@"~"stringByExpandingTildeInPath] //项目的根路径 

 NSLog(@"~ root::%@",[@"~"stringByExpandingTildeInPath]);

打印结果为:

/Users/zander-1989/Library/Application Support/iPhone Simulator/4.3.2/Applications/F511202C-9CE1-4131-A2A0-B6D1846218CD

2.项目下临时文件temp目录的路径

[@"~/temp"stringByExpandingTildeInPath]

3. .app的路径

[NSBundle mainBundle]

/Users/zander-1989/Library/Application Support/iPhone Simulator/4.3.2/Applications/F511202C-9CE1-4131-A2A0-B6D1846218CD/yourAppName.app

4. .app项目应用文件内的文件路径

NSString *path3 = [[NSBundlemainBundle] pathForResource:@"index" ofType:@"html"];

//path3表示的 是 发布到虚拟器上项目的整个发布目录下的 .app应用文件中名字为 index.html 的一个文件的路径

原文地址:https://www.cnblogs.com/zander/p/2616347.html