Xcode 7 调试输出:“错误:177:超时...mMajorChangePending=0”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32256052/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 7 debug output: "ERROR:177: timed out...mMajorChangePending=0"
提问by phatmann
I am seeing the following error in Xcode 7 build 6 debug console when running my app in the iOS 9 simulator:
在 iOS 9 模拟器中运行我的应用程序时,我在 Xcode 7 build 6 调试控制台中看到以下错误:
2015-08-27 11:31:25.464 Reps[87841:2572333] 11:31:25.463 ERROR: 177: timed out after 0.012s (589 590); mMajorChangePending=0
Has anyone else seen this? Any idea what it means?
有没有其他人看过这个?知道这意味着什么吗?
回答by Prateek
Could you post more code for this?
你能为此发布更多代码吗?
I had the same error and it turned out I was being stupid. I already declared
var player = AVAudioPlayer()
outside of viewDidLoad.
我有同样的错误,结果证明我很愚蠢。我已经var player = AVAudioPlayer()
在 viewDidLoad 之外声明
了。
I was then trying let player = try AVAudioPlayer....
我当时正在尝试 let player = try AVAudioPlayer....
I got rid of the let
as I had already declared the variable.. God knows what I was thinking putting let there! All seems to work fine now :)
我摆脱了,let
因为我已经声明了变量......天知道我在想什么把 let 放在那里!现在似乎一切正常:)
回答by Greg
I just encountered a similar problem with a different Error number while revising an old app. It was written in Objective C under iOS 4 and synthesises audio without using XIB or storyboards and it has successfully made the transition to AVFoundation under iOS9. Putting some final touches in place, I ran into this weird problem though it had a different error number. I found several reports of Error 177and Error 181, mostly by Swift developers.
我刚刚在修改旧应用程序时遇到了具有不同错误号的类似问题。它是在 iOS 4 下用 Objective C 编写的,在不使用 XIB 或故事板的情况下合成音频,并成功过渡到 iOS9 下的 AVFoundation。进行一些最后的润色,我遇到了这个奇怪的问题,尽管它有不同的错误编号。我发现了一些关于Error 177和 Error 181 的报告,主要是 Swift 开发人员。
I got this report when I tapped a button to stop audio playback.
当我点击一个按钮停止音频播放时,我收到了这个报告。
2016-06-15 14:50:16.370 SatGam[2598:148012] tapped Button 17
2016-06-15 14:50:16.384 SatGam[2598:148012] 14:50:16.383 ERROR: 181: timed out after 0.012s (1908 1909); mMajorChangePending=0
2016-06-15 14:50:16.387 SatGam[2598:148012] launch with full gradient background
2016-06-15 14:50:16.387 SatGam[2598:148012] load FamilyView
Button 17 is meant to turn off audio before switching to another ViewController which it did successfully before it went into debug. The following commented case statement describes what it was doing at the time
按钮 17 用于在切换到另一个 ViewController 之前关闭音频,它在进入调试之前成功完成。以下带注释的 case 语句描述了它当时在做什么
case 17: // stop button
[synthLock lock]; // lock synthLock
[synth stopAllNotes]; // change synth i.e. mute sound
[synthLock unlock]; // unlock synthLock
[timer invalidate]; // kill the timer
timer = nil; // and then
[timer release]; // release it
// [lastEventChangeTime release]; // this was switched off
[player release]; // release old view controller
[synth release]; // release synth
[synthLock release]; // release synth lock
[self goToFamilyView]; // go to new view controller
break;
I hadn't released lastEventChangeTime
, a property associated with a timer used for audio playback. So I removed comments from the start of that line, re-ran my project on the simulator, hit button 17 and the problem vanished.
我没有发布lastEventChangeTime
,这是一个与用于音频播放的计时器相关联的属性。所以我删除了该行开头的注释,在模拟器上重新运行我的项目,点击按钮 17,问题就消失了。
Based on what you've told us, the problem you describe is likely to be related to something wrong when audio play back starts or stops. Post some code with a few comments that indicate what you've tried and I'm sure someone with more experience in Swift will be able to help. Best of luck.
根据您告诉我们的情况,您描述的问题很可能与音频播放开始或停止时出现问题有关。发布一些带有一些注释的代码,表明您已经尝试过什么,我相信在 Swift 方面有更多经验的人将能够提供帮助。祝你好运。
回答by sabita samal
This works for me
这对我有用
var sound :SystemSoundID = 0
var 声音:SystemSoundID = 0
func Sound() {
功能声音(){
let rightSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("sound", ofType: "wav")!)
AudioServicesCreateSystemSoundID(rightSound, &sound)
AudioServicesPlaySystemSound(self.sound);
}