title: Assigning String to Double.... Thread 1: EXC_BAD_INSTRUVTION (code=EXC_I386_INVOP, subcode=0x0)
body: <p>I have a Picker View (I call them spinners) with two components which happen to equate to £ and pence values... The data source for each is 0 to 99 so that a user can select any value from £0.00 to £99.99</p>
  
  <p>I have the following bit of code with a prepareForSegue function</p>
  
  <pre><code>//need to find out what the spinner is set to
  var firstComponent = pickerData[0][spinFuelAmount.selectedRowInComponent(0)]
  firstComponent = firstComponent.stringByReplacingOccurrencesOfString( "£ ", withString: "" )
  
  var secondComponent = pickerData[1][spinFuelAmount.selectedRowInComponent(1)]
  secondComponent = secondComponent.stringByReplacingOccurrencesOfString( "  .", withString: "" )
  
  let amountAsString = firstComponent + "." + secondComponent
  Data.sharedData.fuelAmount = Double(amountAsString)!
  </code></pre>
  
  <p>Data.sharedData.fuleAmount is declared as a Double in my singleton class...</p>
  
  <pre><code>import Foundation
  
  class Data: NSObject {
  
      static let sharedData = Data()
  
      var startMileage: String!
      var previousMileage: String!
      var startLocation:String!
      var endLocation:String!
  
      var didFillUp: Bool!
  
      var previousFuelMileage: String!
      var fuelFillMileage: String!
      var fuelAmount: Double!
  
      var sender: String!
  
  }
  </code></pre>
  
  <p>When run the program breaks at the last of these lines with the error Thread 1: EXC_BAD_INSTRUVTION (code=EXC_I386_INVOP, subcode=0x0) </p>
  
  <p>As I'm new to Xcode and Swift I'm struggling trying to debug and find the cause... Any help appreciated.</p>