I get an error
'stringByAppendingPathComponent' is unavailable: Use 'stringByAppendingPathComponent' on NSString instead.
when i try to do
let documentsFolder = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as String let databasePath = documentsFolder.stringByAppendingPathComponent("test.sqlite")
This apparently worked for people before, but now it does not work for me in Xcode 7 beta 5.
In this thread on the Apple developer forums, it was suggested to use the extension or make a direct tide of NSString . But if I convert it to NSString
let databasePath = documentsFolder.stringByAppendingPathComponent("test.sqlite" as NSString)
then i get an error
'NSString' is not implicitly convertible to 'String'...
and it gives me the opportunity to "fix" by inserting as String , which returns us to the original error.
This also happens for stringByAppendingPathExtension .
What should I do?
ios path swift
Suragch Aug 20 '15 at 14:10 2015-08-20 14:10
source share