gpt4 book ai didi

ios - "Call can throw, but it is not marked with ' 通过将我的项目转换为 swift 2 来尝试 ' and the error is not handled"

转载 作者:行者123 更新时间:2023-11-28 12:56:02 24 4
gpt4 key购买 nike

<分区>

我尝试将我的项目转换为 Swift 2,但遇到以下错误

Call can throw, but it is not marked with 'try' and the error is not handled

这是我的代码:

 override func viewDidLoad() {

// Do any additional setup after loading the view.
super.viewDidLoad()

let query = PFUser.query()
query!.whereKey("username", equalTo: username)

var userArray = query!.findObjects() as! [PFUser]
user = userArray[0]
}

错误在以下几行:

 var userArray = query!.findObjects() as! [PFUser]
user = userArray[0]

你能帮帮我吗?非常感谢!

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com