问题标签 [exc-bad-instruction]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
69 浏览

xcode - AVAudioPath 不工作 - 斯威夫特

我正在尝试根据用户选择的乐器播放歌曲。这是我的代码:

@IBAction func 播放(发件人:AnyObject){

除了instrumentSelect.selectedSegmentIndex == 1. 我不知道为什么。我得到一个EXC_BAD_INSTRUCTIONfatal error: unexpectedly found nil while unwrapping an Optional value。该文件工作正常,我已经多次清理该项目。我已经正确输入了所有内容。为什么那个不工作?我对此感到非常困惑,感谢您的帮助。

0 投票
2 回答
1139 浏览

swift - EXC_BAD_INSTRUCTION(代码 = EXC_I386_INVOP,子代码 = 0x0)

我正在创建一个温度转换器。当我运行应用程序时;输入温度,选择转换并单击转换。出现错误。错误是:EXC_BAD_INSTRUCTION(代码 = EXC_I386_INVOP,子代码 = 0x0)

这是我的 ViewController 代码:

这是我得到错误的地方。TempConverterModel.swift

我不知道我做错了什么。我想检查 labelConvertFrom 中的文本并检查它是否等于“Celsius”。如果它没有返回答案。

我真的很感谢任何人的帮助。谢谢!

0 投票
1 回答
27 浏览

ios - 应用程序启动前崩溃

我越来越

EXC_BAD_INSTRUCTION(代码=EXC_I386_INVOP,子代码=0x0)

它甚至在应用程序启动之前就崩溃了。顺便说一句,编程新手。

谢谢你

0 投票
1 回答
312 浏览

ios - Exc_bad_instruction with SWRevealViewController

Background My app has one MainViewController with a UIButton which leads to another ViewController when pressed. In the second ViewController is a UIBarButtonItem which has a "Back" segue to the MainViewController. Everything has worked fine, until now when I programmed a slide out menu with help from SWRevealViewController and I followed this Jared Davidson tutorial https://www.youtube.com/watch?v=8EFfPT3UeWs (simple, general and easy)

Problem The slide out menu works perfectly, but now when the "Back" button in the second ViewController is pressed crashes the app due to

EXC_BAD_INSTRUCTION (code=EXC_I1386_INVOP, subcode=0x0)

from the following code in the MainViewController file, regarding the pan gesture for the slide out menu.

Code

This is my MainViewControllers code regarding my slide out menu. It works perfectly, but it inferrers with the simple "Back" segue on the second ViewController.

When the last line of code is deleted works the "Back" segue again, but obviously not the slide out menu.

Help Is it possible specify the pan gesture code to only the MainViewController and its slide out menu, and let the "Back" segue only show the MainViewController like before and/or "ignore" this line of code. Or is it possible in some other way to separate this two and avoid my app from crashing when the "Back" segue from the second ViewController (back to the MainViewController) is pressed?

Thanks in advance legends.

0 投票
1 回答
122 浏览

ios - 解析子类实例方法 EXC_BAD_INSTRUCTION

从 parse user object 子类PFUser化时,使用自己的方法时会出现错误指令错误。你们有什么想法为什么会发生这种情况

用户.swift

ViewController.swift

导入 UIKit

0 投票
0 回答
348 浏览

ios - 核心数据并发调试 - exc_bad_instruction

我想优化核心数据并设置com.apple.CoreData.ConcurrencyDebug 1标志。现在我得到谓词的exc_bad_instruction错误。我没有找到关于它的足够信息,只能是 nil 值,但我不知道如何修复它。在此处输入图像描述

0 投票
1 回答
84 浏览

ios - Swift 错误线程 1:EXC_BAD_INSTRUCITON

嗨,我刚刚学得很快,需要一些帮助。当我运行我的应用程序时,它崩溃了。我得到和错误

它说:

线程 1:EXC_BAD_INSTRUCTION(代码=EXC_I386_INVOP,子代码=0x0)

我试着把它放在一个if声明中,即

然后我的应用程序被加载,但是当我按下player1AttackBtn on那条线时我得到了同样的错误。

任何帮助将不胜感激!提前致谢!!!

家长班

玩家等级

视图控制器

0 投票
2 回答
503 浏览

swift - 简单的 Swift Fibonacci 程序崩溃(Project Euler 2)

我正在尝试解决 Project Euler 的第二个问题。问题如下:


斐波那契数列中的每个新项都是通过添加前两项来生成的。从 1 和 2 开始,前 10 项将是:1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... 通过考虑斐波那契数列中其值不超过的项四百万,求偶数项之和。


我想我已经写了一个解决方案,但是当我尝试运行我的代码时,它会导致我的 Swift 操场崩溃并给我这个错误消息:

Playground execution aborted:执行被中断,原因:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)



奇怪的是,如果我将循环上的计数器设置为小于 93,它就可以正常工作。将变量名称显式设置为 Double 无济于事。有人知道这里发生了什么吗?

0 投票
2 回答
521 浏览

swift - EXC_BAD_INSTRUCTION 错误

我知道有很多关于这个错误的问题,但我还没有找到解决我的问题的方法,即使我阅读了其中的大部分内容。在视图控制器中,我试图让我的文本视图显示文本顶部,而不是底部。当只有一个 textView 时,一切正常,但是当我尝试使用其中两个时,我得到 EXC_BAD_INSTRUCTION 错误。

0 投票
0 回答
92 浏览

ios - thread1: swift 上的 exc_bad_instruction

我确实有错误 Thread1:EXC_BAD_INSTRUCTION。在这方面一直很努力。那里有有用的人员吗?

导入 UIKit 导入 AVFoundation

类 PlaySoundsViewController: UIViewController {

}