是否有人在Xcode 11(和11.1)中通过AVAudioPlayer收到此控制台消息? [英] Is anyone else getting this console message with AVAudioPlayer in Xcode 11 (and 11.1)?

查看:97
本文介绍了是否有人在Xcode 11(和11.1)中通过AVAudioPlayer收到此控制台消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用AVAudioPlayer的简单示例程序,并且在运行它时收到此消息.这是在调用 .play()之前发生的:

I have a simple example program with AVAudioPlayer and am getting this message when I run it. This occurs before .play() is called:

2019-10-08 12:34:53.093726 + 1100 PlayNotes2 [1587:137643] [plugin] AddInstanceForFactory:没有工厂注册ID为 F8BB1C28-BAE8-11D6-9C31-00039315CD46

2019-10-08 12:34:53.093726+1100 PlayNotes2[1587:137643] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000c580e0> F8BB1C28-BAE8-11D6-9C31-00039315CD46

程序运行正常,但我担心收到此消息.

The program works fine, but I'm concerned to be getting this message.

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

Here is my complete code. It just has one button on the view with the playButtonTap outlet. Note that the same thing happens if I use the commented out declaration for 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()
    } 
}

推荐答案

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

The warning is unimportant. If you really object to it, run the app on a device instead of in a simulator. The console message will go away.

这篇关于是否有人在Xcode 11(和11.1)中通过AVAudioPlayer收到此控制台消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆