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
1 answer

Subclassing in Swift SpriteKit

I'm making an RPG-type game, in which you can choose the attack your user has. I'm trying to make it so that I have a superclass named "Projectile", where general variables are described, and subclasses that change the variables. But whenever I…
Mahmud Ahmad
  • 171
  • 3
  • 18
0
votes
1 answer

EXC_BAD_INSTRUCTION (code =EXC_1386,INVOP,subcode=0x0) error

When I try to pull the content subclass of my NewsPages Class from my Parse.com account, the app crashes and the log gives me the : EXC_BAD_INSTRUCTION (code =EXC_1386,INVOP,subcode=0x0) error. Please Help Me fix this. Here is the Code: import…
0
votes
1 answer

EXC_BAD_INSTRUCTION object array assign Swift

I have an array of Printable objects, but I need them Equatable and AnyObject compliant. private(set) var items: [Printable] = [] class func withItems(items: [T], selectedItem: T? = nil) { ...…
Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162
0
votes
1 answer

Using array values to init new array elements

I've put together the following sample code: let tings = [1, 2, 4, 5, 6, 8] class Foo { var number: Int init(something: Int) { self.number = something } } var list: [Foo] = [] for num in tings { var temp = Foo(something:…
Simon
  • 2,419
  • 2
  • 18
  • 30
0
votes
3 answers

EXC_BAD_INSTRUCTION bug

I have gotten this problem several times in Xcode 6. the thing is that I got a ball running and when he hits a block he dies. he can jump though. but the very first block always crashes. like if I just roll normally like not in the air and hit the…
Flame
  • 1
  • 1
  • 2
0
votes
1 answer

NSUserDefaults crashes with EXC_BAD_INSTRUCTION

My app is crashing with EXC_BAD_INSTRUCTION(code=EXC_i386_INVOP, subcode=0x0). The console logs (lldb). I'm trying to use NSUserDefaults with NSKeyedArchiver and NSKeyedUnarchiver. The class I'm trying to serialise is a subclass of NSManagedObject,…
-1
votes
1 answer

swift: load specific data based on indexPath.row

Problem: I want to use a single viewcontroller to load data, specifically text and images, according to the indexPath.row of my tableview. All cells are segued to the one viewcontroller. I am loading the labels and images from arrays. When the…
Hunter
  • 313
  • 5
  • 20
-1
votes
1 answer

Swift bad instruction error shopping list

I have a problem, Xcode gives me this error "EXC_BAD_INSTRUCTION(code=EXC_1386_INVOP,subcode==0*0)" while I'm trying to make my buttons delete indexes in my array, "shoppingList". Please help me and tell me what i did wrong so i can improve later…
A. stein
  • 87
  • 1
  • 1
  • 7
-1
votes
2 answers

EXC_BAD_INSTRUCTION Error Swift 2

I am developing an application using Swift 2 and Xcode 7 beta 6. I am trying to change the title of a button. My code: print(randomNumber) myButton.setTitle("\(randomNumber)", forState: UIControlState.Normal) It gives me this: fatal error:…
Pranav Wadhwa
  • 7,666
  • 6
  • 39
  • 61
-1
votes
1 answer

kCATransitionFade bad_instruction

var Testing: CATransition! Testing.type = kCATransitionFade Testing.duration = 1 Testing.delegate = ColorBox I am using Swift. On the second line, I get the error EXC_BAD_INSTRUCTION. I have read into this error and have found that this could be…
-1
votes
2 answers

NSJSONSerialization no returns error

There code: var err: NSError var jsonDict = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &err) as Array If data has JSON it's works perfect. But if there something other (not…
Max
  • 1,341
  • 3
  • 20
  • 39
-2
votes
1 answer

Why I get this error EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

Can anyone help me please and tell me why do I get error on line 2? message box also says: SignIn fatal error: unexpectedly found nil while unwrapping an Optional value (lldb) @IBAction func done(sender: UIBarButtonItem) { if isSignIn ==…
Gediminas Tam
  • 25
  • 1
  • 8
-2
votes
2 answers

Array Index out of range

var Password1 : Array = [Int]() var Password2 : Array = [Int]() while Password1.count < 800 { var RandomNum1 = Int(arc4random_uniform(256)) var RandomNum2 = Int(arc4random_uniform(256)) Password1[Password1.count] = RandomNum1 …
-4
votes
3 answers

How to solve this error? in xcode

warning: Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) import UIKit class ViewController: UIViewController { var count = 0 var label: UILabel! override func viewDidLoad() { super.viewDidLoad() …
Jayesh
  • 1
-5
votes
1 answer

Swift error EXC_BAD_INSTRUCTION

Please I have this code. I'm new to Swift (started only today). What's the problem here? I tried searching stack but found only Objective-C solutions. class ViewController: UIViewController, CLLocationManagerDelegate { var locationManager =…
g_1_k
  • 484
  • 1
  • 6
  • 13
1 2 3 4 5 6
7