Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在变量之前或之后写 try 有什么区别?我的意思是:
do { audioPlayer = try AVAudioPlayer(contentsOf: soundUrl!) } catch { print(error) }
和这个:
do { try audioPlayer = AVAudioPlayer(contentsOf: soundUrl!) } catch { print(error) }
他们都工作我只是好奇。