title: Swift : Cannot assign to "" in self
body: <p>In Swift, I have a computed property called <code>managedObjectContext: NSManagedObjectContext</code>. when I try to initialise it like:</p>
  
  <pre><code>var managedObjectContext: NSManagedObjectContext? {
      get {
          createManagedObjectContext()
          return self.managedObjectContext
      }
      set(newManagedObjectContext) {
          self.manageObjectContext = newManagedObjectContext
      }
  }
  
  func createManagedObjectContext() -&gt; NSManagedObjectContext {
  
      if let coordinator = persistentStorageCoordinator() as NSPersistentStoreCoordinator!
      {
          self.managedObjectContext = NSManagedObjectContext()
          self.managedObjectContext!.persistentStoreCoordinator = coordinator
  
          NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleBackgroundMOCDidSaveNotification:", name: NSManagedObjectContextDidSaveNotification, object: self.managedObjectContext)
      }
  
      return self.managedObjectContext!;
  }
  </code></pre>
  
  <p>I am getting an error saying : <code>Cannot assign to "managedObjectContext" in self</code>.</p>
  
  <p>Can anybody help to fix this?</p>
  
  <p>Thanks in advance.</p>