Using iOS 9 I'm trying to use NSFileManager's moveItemAtURL :
do { print(localURL) // http://localhost:3000/api/v1/activities print(cacheFile) // file:///Users/kyledecot/Library/Developer/CoreSimulator/Devices/35C03988-D8F5-42E5-AB35-B99BE461EEAE/data/Containers/Data/Application/69593B3A-F764-4BC3-89AD-72B701BF85C8/Library/Caches/activities.json try fileManager.moveItemAtURL(localURL, toURL: cacheFile) } catch let error as NSError { print(error) }
When I get an error, I get:
Domain Error = NSCocoaErrorDomain Code = 262 "The file" action "could not be opened because the http URL is not supported." UserInfo = {NSURL = http: // localhost: 3000 / api / v1 / activities }
Update # 1
I have already added the appropriate values ββto my Info.plist to make sure that the ATS is happy (see screenshot). Which is strange that I can download data from my local server using HTTP (via dataTaskWithRequest: , but NSFileManager then complains about the same URL when trying to execute moveItemAtURL .

source share