Dev.Debug我在 xcode 中的react-native 项目中添加了一个新的构建配置,复制现有Debug配置,并为新配置添加了相应的方案。
现在,当我尝试使用新方案运行项目时,出现错误:
Undefined symbol: _OBJC_CLASS_$_FlipperClient
运行我复制的方案工作正常 - 应用程序安装、启动并正常运行。
添加新的调试方案后是否还需要进行更多配置?
我正在开发一个运动应用程序,当该应用程序进入后台以及锁定屏幕时,它需要能够播放声音。我还需要允许播放其他应用程序的声音(例如音乐),同时还要使我的声音效果通过。
我通过使用AVAudioSessionCategoryAmbient在iOS 9中进行了此操作,但是一旦我的应用程序变为非活动状态或屏幕锁定,声音就会停止。
这是演示应用程序中我的代码的简化版本:
import UIKit
import AVFoundation
class ViewController: UIViewController {
var session: AVAudioSession = AVAudioSession.sharedInstance()
var timer = Timer()
let countdownSoundFile = "154953__keykrusher__microwave-beep"
let countdownSoundExt = "wav"
var audioPlayer = AVAudioPlayer()
override func viewDidLoad() {
super.viewDidLoad()
activateAudio()
}
func activateAudio() {
_ = try? session.setCategory(AVAudioSessionCategoryAmbient, with: [])
_ = try? session.setActive(true, with: [])
}
@IBAction func play() {
timer = Timer.scheduledTimer(timeInterval: 2.0, target: self, selector: #selector(ViewController.playSound), userInfo: nil, repeats: true)
}
func playSound() {
if let soundURL = …Run Code Online (Sandbox Code Playgroud)