title: Swift error: EXC_BAD_INSTRUCTION (code=EXC_l386_INVOP,subcode=0x0)
body: <p>I get an error when trying to execute this code:</p>
  
  <pre><code>Thread 1: EXC_BAD_INSTRUCTION (code=EXC_l386_INVOP,subcode=0x0)
  </code></pre>
  
  <p>Let FWeight line is highlighted in red.</p>
  
  <p>Let BWeight line is highlighted in Yellow.</p>
  
  <hr>
  
  <pre><code>import UIKit
  
  class detailedViewController: UIViewController {
  
      static var cc : Food!
  
  
      override func viewWillAppear(animated: Bool) {
          //Click on a meal, get to detail, displays all of it, go back one step: press chicken wont work. Everytime we switch to different meal it will recalculate.
  
          let Rweight = Int((detailedViewController.cc.RProteins / 100)*Double(ViewController.minimum))
  
          print(detailedViewController.cc)
  
          let Fweight = Int((detailedViewController.cc.FProteins / 100)*Double(ViewController.minimum))
  
          print(Fweight)
  
          let Bweight = Int((detailedViewController.cc.BProteins / 100)*Double(ViewController.minimum))
  
          print(Rweight)
  
      }
  </code></pre>
  
  <p>This page should show different meals, and when you press on the meal on the table it should display how much you should eat of that food, in 3 different states either raw, fried or boiled. The method above should calculate how much protein there is in 1 gram of the food and times that by the users weight, to see how much they have to consume. Currently my table meals are 100g, so thats why I divide by 100 in the method.</p>