title: How to delete object from realm database in table view controller
body: <p>if this is my code then why i get the error: Value of type 'RLMResults' has no member 'arraySortedByProperty' when I'm using realm fore saying data.</p>
  
  <pre><code>var items = [NSManagedObject]()
  
  var todos: RLMResults {
      get {
          return ToDoItem.allObjects()
      }
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
      title = "Todos"
  
  }
  
  
  func deleteRowAtIndexPath(indexPath: NSIndexPath)
  {
      let realm = RLMRealm.defaultRealm() //1
      let objectToDelete = todos[UInt(indexPath.row)] as! ToDoItem //2
      realm.beginWriteTransaction() //3
      realm.deleteObject(objectToDelete) //4
      realm.commitWriteTransaction() //5
  
       todos = ToDoItem.allObjects().arraySortedByProperty("name", ascending: true) //6
  
      tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) //7
  }
  </code></pre>