IOS Dev (22) file and Path
- Author: CSDN laruence
- Blog: http://blog.csdn.net/preventionsandbox path
Like many other APP platforms, iOS limits the activity scope of each APP and can only be limited to one hard disk space, that is, Sandbox. How to get this Sandbox. It is easy:
NSString * outDirPath = [NSHomeDirectory () stringByAppendingPathComponent: @ "Documents"];
This outDirPath is the sandbox path.
Obtain the Resource pathResource and Sandbox are not in the same path. Resource is determined by the system when an application is created by the system. You can only ask the system.
NSString * wavFilePath = [[NSBundle mainBundle] pathForResource: @ "abc" ofType: @ "jpg"];
The above NSBundle mainBundle method obtains the path of the application. This sentence finds the abc.jpg file.
-
Reprinted please indicate from: http://blog.csdn.net/prevention