还有其他人在 Xcode 11(和 11.1)中使用 AVAudioPlayer 收到此控制台消息吗?

Ian*_*Ian 3 avaudioplayer ios swift

我有一个带有 AVAudioPlayer 的简单示例程序,当我运行它时收到此消息。这发生在.play()称为:

2019-10-08 12:34:53.093726 + 1100 PlayNotes2 [1587:137643] [插件] AddInstanceForFactory:没有为 id <CFUUID 0x600000c580e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46 注册工厂

该程序运行良好,但我担心收到此消息。

这是我的完整代码。它在带有插座的视图上只有一个按钮playButtonTap。请注意,如果我使用注释掉的声明,也会发生同样的事情var audioPlayer

import UIKit
import AVFoundation

class ViewController: UIViewController {

    let soundFileName = "E_64kb"

    //  var audioPlayer = AVAudioPlayer()
    var audioPlayer: AVAudioPlayer?

    override func viewDidLoad() {
        super.viewDidLoad()

        let sound = Bundle.main.path(forResource: soundFileName, ofType: "mp3")
        do {
             audioPlayer = try AVAudioPlayer(contentsOf: URL(fileURLWithPath: sound!))
        } catch {
            print(error)
        }
    }

    @IBAction func playButtonTap(_ sender: Any) {
        audioPlayer!.play()
    } 
}
Run Code Online (Sandbox Code Playgroud)

mat*_*att 5

警告并不重要。如果您确实反对,请在设备上运行该应用程序,而不是在模拟器中。控制台消息将消失。

  • 只是补充一点 - 正如 @matt 所说,实际设备上没有警告。 (4认同)