【问题标题】:Swift Audio passing to another ViewControllerSwift Audio 传递给另一个 ViewController
【发布时间】:2018-07-27 11:56:04
【问题描述】:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 
    if segue.identifier == "stopRecording" {             
        let playSoundsVC = segue.destination as! PlaySoundsViewController          
        let recordedAudioURL = sender as! URL           
        playSoundsVC.receivedAudio = recordedAudioURL               
    }
}

问题是我的 Xcode 生成错误

“PlaySoundsViewController”类型的值没有成员“receivedAudio”

【问题讨论】:

  • PlaySoundsViewController 中是否有一个名为 receivedAudio 的变量?

标签: swift xcode audio segue viewcontroller


【解决方案1】:

为此,destinationVC 应该如下所示

class PlaySoundsViewController:UIViewController {

    var receivedAudio:URL?

    .....
 }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多