沙盒目录
let path = NSHomeDirectory()
print(path)
print("----------------------")
Documents
let doct1 = path + "/Documents"
print(doct1)
let doct2 = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
print(doct2.first!)
print("----------------------")
Caches
cachesPath1 = NSSearchPathForDirectoriesInDomains(.CachesDirectory, .UserDomainMask, true)
print(cachesPath1.first!)
print("----------------------")
tmp
let tmpPath = path + "/tmp"
print(tmpPath)
print("----------------------")
App
let mainPath = NSBundle.mainBundle().bundlePath
print(mainPath)
let resoursePath = NSBundle.mainBundle().resourcePath
print(resoursePath!)
print("----------------------")
info.plist
let infoPath = mainPath + "/info.plist"
print(infoPath)
print("----------------------")
#Java教程新目录.html
```swift
let htmlPath = NSBundle.mainBundle().pathForResource("Java教程新目录", ofType: "html")
print(htmlPath!)
print("----------------------")
URL: NSURL(2.0)/URL(3.0)
let urlPath = NSURL(fileURLWithPath: htmlPath!)
print(urlPath)
let resURL = NSBundle.mainBundle().URLForResource("Java教程新目录", withExtension: "html")
print(resURL!)