swift - Xcode 11 使用 Parse 连接到 Amazon Web Service 时出错
问题描述
我正在尝试连接到我的 AWS 服务器,但是当我尝试在那里保存一个对象时,Xcode 无法到达并给我这个错误:
可选(错误域=解析代码=0“未授权”用户信息={错误=未授权,NSLocalizedDescription=未授权,临时=0})
这是我在 appDelegate 上的代码:
Parse.enableLocalDatastore()
let parseConfiguration = ParseClientConfiguration(block: { (ParseMutableClientConfiguration) -> Void in
ParseMutableClientConfiguration.applicationId = "*******"
ParseMutableClientConfiguration.clientKey = "****************"
ParseMutableClientConfiguration.server = "http://ec2-3-22-186-169.us-east-2.compute.amazonaws.com/parse"
})
Parse.initialize(with: parseConfiguration)
testParseSave()
return true
}
func testParseSave() {
let testObject = PFObject(className: "MyTestObject")
testObject["foo"] = "bar"
testObject.saveInBackground { (success, error) -> Void in
if success {
print("El objeto se ha guardado en Parse correctamente.")
} else {
if error != nil {
print("is NOT nil:")
print (error as Any)
} else {
print("IS nil:")
print ("Error")
}
}
}
}
提前致谢!
解决方案
推荐阅读
- selenium-webdriver - Starting Edge Chromium in InPrivate mode / headless mode did not work for selenium
- javascript - what features of Google Analytics can be used in Electron-Vue application
- x11-forwarding - Snap applications through a remote X11 session
- java - Bean initialized with FactoryBean receives the FactoryBean instead of the Obect created by it
- python - How can I change the data type to run the program faster?
- reactjs - How to use react to implement google Place's Searches, to create markers on the map?
- javascript - Sweetalert Validation null control
- android - 显示和字体较大时手动计算可用宽度不正确
- python - 向量的 Keras 二进制精度
- c# - 重定向子进程的标准输出时命名管道性能不佳