title: Value of type ... has no member
body: <p>Hello I'm new to Swift and I'm learning it on iTunes U, the Stanford University course. And I'm programming a calculator. The instructor in the course video has the same code, software and same version of XCode. </p>
  
  <p>Here's the relevant code for ViewController:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
      @IBOutlet private weak var display: UILabel!
  
      private var displayValue: Double {
  
          get {
              return Double(display.text!)!
  
          }
  
          set {
              display.text = String(newValue)
  
          }
      }
  
      ...
  
      private var brain = calculatorBrain()
  
      @IBAction private func performOperation(sender: UIButton) {
          if userIsInTheMiddleOfTyping {
              brain.setOperand(displayValue)
              userIsInTheMiddleOfTyping = false
          }
  
          if let mathematicalSymbol = sender.currentTitle {
              brain.performOperation(mathematicalSymbol)
          }
          displayValue = brain.result
      }
  }
  </code></pre>
  
  <p>The error is in the last sentence: <code>displayValue = brain.result</code>
  This is the error: Value of type 'CalculatorBrain' has no value 'result'</p>
  
  <p>This is the CalculatorBrain code:</p>
  
  <pre><code>import Foundation
  
      func multiply(op1: Double, op2: Double) -&gt; Double {
           return op1 * op2 
      } 
  
      class calculatorBrain {
      private var accumulator = 0.0
  
      func setOperand(operand: Double) {
          accumulator = operand
  
      }
  
      var operations: Dictionary&lt;String,Operation&gt; = [
          "π" : Operation.Constant(M_PI),
          "e" : Operation.Constant(M_E),
          "√" : Operation.UnaryOperation(sqrt),
          "cos" : Operation.UnaryOperation(cos),
          "×" : Operation.BinaryOperation(multiply),
          "=" : Operation.Equals
  
  
      ]
      enum Operation {
          case Constant(Double)
          case UnaryOperation((Double) -&gt; Double)
          case BinaryOperation((Double, Double) -&gt; Double)
          case Equals
      }
  
      func performOperation(symbol: String) {
          if let operation = operations[symbol] {
              switch operation {
              case .Constant(let value): accumulator = value
              case .UnaryOperation(let function): accumulator = function(accumulator)
              case .BinaryOperation(let function):
              case .Equals: break
              }
  
          }
      } 
  }
  
  struct PendingBinaryOperationInfo {
      var BinaryFunction: (Double, Double) -&gt; Double
      var firstOperand: Double 
  }
  
  var result: Double { 
      get {
          return 0.0 
      }
  }
  </code></pre>
  
  <p>So what's the problem?</p>