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

Swift exc_bad_instruction xcode

I am new to iso programming. I am trying to create a small quiz in the app on a view controller. It has 1 label and 4 buttons. I am getting the EXC_BAD_INSTRUCTION at the QLabel.text = Questions[QNumber].Question. I have deleted the label and…
isabella
  • 151
  • 4
  • 15
0
votes
2 answers

EXC_BAD_INSTRUCTION error

I know that there are a lot of questions about this error, but I haven't found solution for my problem, even if I read most of them. In view controller I'm trying to make my text view displaying top of text, instead of bottom of it. When there is…
T. Chechelski
  • 21
  • 1
  • 4
0
votes
1 answer

Swift error Thread 1: EXC_BAD_INSTRUCITON

Hi Im just learning swift and am in need of some help. When I run my app it crashes. I get and error on player1 = Player(name: "\(playerNames[0])", hp: 110, attackPwr: 10) it says: Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP,…
0
votes
1 answer

Parse Subclass Instance Method EXC_BAD_INSTRUCTION

When subclassing from a parse user object PFUser, I get bad-instruction errors when using my own methods. Do you guys have any thoughts on why this is happening User.swift import UIKit import Parse class User: PFUser { // Instance Variables …
0
votes
1 answer

Crashing before the app starts

override func viewWillLayoutSubviews() { let bgMusicURL:NSURL = NSBundle.mainBundle().URLForResource("bgmusic", withExtension: "mp3")! backgroundMusicPlayer = try! AVAudioPlayer(contentsOfURL: bgMusicURL) …
Domo
  • 45
  • 1
  • 6
0
votes
0 answers

UIImage multiple view controller

I am wanting to build an animated image into an ImageView for a project that has multiple view controllers. All of the tutorials that I've seen the instructor add an animated view to have a single ViewController. I'm fairly new to coding and am just…
0
votes
1 answer

UIImage Bad instruction

Looking through the forums I have found that this issue is one that shows its head every now and then. And apparently doing so in a wide scope of different cases. None that I have managed to find seem to be similar to mine though. I'm halfway…
L. Klotz
  • 164
  • 1
  • 15
0
votes
0 answers

EXC_BAD_INSTRUCTION - Swift 2

I am making an iOS application with Swift 2. I have set 10 buttons tags' from 1-10. I am creating a loop for which var i loops through all numbers 1-10. A button I created is set to that tag. I am trying to set that button's image to nil. Here is my…
Pranav Wadhwa
  • 7,666
  • 6
  • 39
  • 61
0
votes
1 answer

Error code when using segmented control for container view

Thanks in advance for the help! I'm trying to use segmented control to change child views inside a container view on one of my view controllers. I found a good answer on SO about this and below was the following code: @IBAction func…
Kody R.
  • 2,430
  • 5
  • 22
  • 42
0
votes
1 answer

EXEC_BAD_INSTRUCTION when trying to get image from Parse

I am getting the error below in the following line: "let imgFile = object["imageFile"] as PFFile" Code: func getRightLevelInfo() { var query = PFQuery(className: "userstatus") query.whereKey("username", equalTo:…
user1406716
  • 9,565
  • 22
  • 96
  • 151
0
votes
1 answer

Why does this equation cause exc_bad_instruction?

I'm getting a runtime error in my Swift code: EXC_BAD_INSTRUCTION (code=EXC_i386_INVOP, subcode=0x0) At line: y = height - (((val - minYval) / (maxYval - minYval)) * height) In context: let height:CGFloat = self.frame.height - yOffset let…
olympia
  • 362
  • 2
  • 20
0
votes
2 answers

Swift: decodeObjectForKey crashes if key doesn't exist

I'm unarchiving a Swift class with the following Swift code: required convenience init(coder decoder: NSCoder) { self.init() horseID = decoder.decodeIntegerForKey("horseID") name = decoder.decodeObjectForKey("name") as String! …
tzer
  • 280
  • 4
  • 11
0
votes
1 answer

Swift TableView SearchDisplayController EXC_BAD_INSTRUCTION

I have a TableView with Persons. When I tap on a cell it performs a seque to another view. Searching works. But when I search, cancel, tap on one cell, go back and want to search again, it crashes. EXC_BAD_INSTRUCTION. func tableView(tableView:…
0
votes
1 answer

Strange EXC_BAD_INSTRUCTION in Swift

Actually, I'm encountering a mystery issue. I'm trying to present a View Controller UIModalPresentationFormSheet and here is the code of that class class AViewController: UIViewController { @IBOutlet weak var a: UILabel! @IBOutlet weak var…
Maystro
  • 2,907
  • 8
  • 36
  • 71
0
votes
1 answer

thread 1 exc_bad_instruction (code=exc_i386_invop, subcode=0x0) using search

I'm trying to use a search function in a table view. the data changes like it supposed to but the moment I hit a cell that has been generated after the search it won't take me to the next view. It crashes on this piece of code on the selectedIndex…
NoSixties
  • 2,443
  • 2
  • 28
  • 65