Questions tagged [exc-bad-instruction]

EXC_BAD_INSTRUCTION is an exception that happens when you try to execute an instruction the CPU doesn't support.

EXC_BAD_INSTRUCTION is an exception in Objective C, which usually occurs when an object has been released before usage, or if the project is running a vector extension which is not supported on the CPU where it is being compiled.

105 questions
0
votes
0 answers

Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) what went wrong?

I got this sigabrt error : Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) as shown in the view did load The code is responsible for following an unfollowing users The sigabrt error occurs during segue from the search View to the…
0
votes
1 answer

Swift 3 - 'EXC_BAD_INSTRUCTION(code=EXC_1386_INVOP,subcode=0x0)' Error

I am working on a maze game in swift 3 and it compiles but when I run it I get the EXC_BAD_INSTRUCTION error. I'm relatively new to swift so I don't know how to properly debug it. Here is the piece of code that is getting the…
Henry Pigg
  • 90
  • 1
  • 1
  • 6
0
votes
0 answers

Error whilst "numberOfLines"

class ViewController: UIViewController { @IBOutlet weak var btn: UIButton! override func viewDidLoad() { // Error on following line: "Thread 1: EXC_BAD_INSTRUCTION" btn.titleLabel?.numberOfLines = 1; …
Old York
  • 73
  • 1
  • 9
0
votes
1 answer

Not showing merged image and text in swift 3

Hi I am new to swift 3 and Xcode 8 I have an issue in my below code Build get succeeded and it runs well in a simulator but image and text are not get showed what I did wrong? import UIKit class ViewController: UIViewController { override func…
imac apple
  • 53
  • 1
  • 9
0
votes
0 answers

Swift Error : EXC_BAD_INSTRUCTION in UIWebView

I am developing a web view application with Swift programming language. I made a control on the URL because if it's a URL of Youtube,Facebook or something else external to the primary website, I want to open the URL in Safari. Until here everything…
alex
  • 380
  • 3
  • 8
0
votes
1 answer

Swift Firebase. Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

If I am correct: EXC_BAD_INSTRUCTION means that the app crashed because something does not exists. (After googling it and trying to get my head round it) However I am getting the error: Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP,…
JamesG
  • 1,552
  • 8
  • 39
  • 86
0
votes
0 answers

EXC_BAD_INSTRUCTION Error in AppDelegate (Bundle.main.url?)

I am having a problem within my AppDelegate but can't find the mistake, I checked the bundle identifier but it still doesn't work, there is my code : lazy var applicationDocumentsDirectory: NSURL = { let urls = FileManager.default.urls(for:…
user7098356
0
votes
1 answer

Error when I try to use NSTimer to change View Controller(EXC_BAD_INSTRUCTION)

I am trying to change a view controller after an animation. I used an NSTimer to change the view controller after the animation is done. The animation takes place on the default ViewController given. After this animation runs once, it's supposed to…
DrPepperGrad
  • 361
  • 1
  • 4
  • 17
0
votes
1 answer

Swift: Execution was interrupted, reason: EXC_BAD_INSTRUCTION error

When I attempt this in Playground: func StockEvolution(S_0:Double, _ down:Double, _ up:Double, _ totalsteps:Int, _ upsteps:Int) -> Double // function being used in calcCall() { var S_t:Double = S_0 * pow(up, Double(upsteps)) * pow(down,…
0
votes
2 answers

exc_bad_instruction when setting UIView center to cgpoint

I've just started learning Swift, and I've been trying to move a UIView in response to a touch. I'm getting an exc_bad_instruction error. var location = CGPoint(x: 0, y:0) @IBOutlet weak var person: UIView! override func touchesBegan(_ touches:…
D. Cohen
  • 567
  • 1
  • 7
  • 22
0
votes
1 answer

Index out of range for indexPath swift

I am making an app that requires the user to tap on multiple cells in order to select them. when they tap on a cell, a .Checkmark accessory item will appear. For some reason though whenever I try and get to that VC the app crashes and I get the…
0
votes
1 answer

Bad Exception on swipe action cell Swift

I'm making an app that is sending information about text inside of cells to a WebViewController using swipe actions. The swipe action is: let sendToWebsite = UITableViewRowAction(style: .Default, title: "Website") { (action, indexPath) in …
zach2161
  • 113
  • 11
0
votes
0 answers

Bad instruction error for indexPath Swift

i'm making an app that needs to transfer data using segues and cells. I have two nearly identical View Controllers but one of them is getting the following error on line 3 whenever I launch it: I know that Bad Instruction errors mean that it is…
zach2161
  • 113
  • 11
0
votes
2 answers

In my equation solving program, inputting nil value crashes app

I have made an app that solves quadratic equations (just to see if I could), however, I don't want the app to crash if the user accidentally inputs no value for one of the slots. Please help. @IBAction func solveButton(sender: AnyObject) { …
RufusV
  • 408
  • 3
  • 17
0
votes
1 answer

Fatal Error - Unexpectedly Found nil while unwrapping an Optional Value

I am trying to work on a chat application using swift and when I build and ran the project during the run when I try to go to the ChatVewController it shows this EXC Bad Instruction Error. The console says Fatal Error: Unexpectedly found nil while…