URI,URL和URN之间有什么区别?我读过很多网站(甚至维基百科),但我不明白.
URI:http://www.foo.com/bar.html
URL:http://www.foo.com/bar.html
URN:bar.html
它是否正确?
我收到了错误
'stringByAppendingPathComponent' is unavailable: Use 'stringByAppendingPathComponent' on NSString instead.
Run Code Online (Sandbox Code Playgroud)
当我尝试做的时候
let documentsFolder = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as String
let databasePath = documentsFolder.stringByAppendingPathComponent("test.sqlite")
Run Code Online (Sandbox Code Playgroud)
这显然对以前的人有用,但现在在Xcode 7 beta 5中对我不起作用.
这个线程在苹果开发者论坛不得不使用分机或直接做投地的建议NSString.但如果我把它转换为NSString
let databasePath = documentsFolder.stringByAppendingPathComponent("test.sqlite" as NSString)
Run Code Online (Sandbox Code Playgroud)
然后我得到了错误
'NSString' is not implicitly convertible to 'String'...
Run Code Online (Sandbox Code Playgroud)
它让我可以选择通过插入来"修复它" as String,这会让我们回到原来的错误.
这也适用于stringByAppendingPathExtension.
我该怎么办?