title: Getting specific attributes from coredata swift
body: <p>I have a request for an entity in core data:</p>
  
  <pre><code>override func viewWillAppear(animated: Bool) {
      let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
  
      let managedContext = appDelegate.managedObjectContext
  
      let fetchRequest = NSFetchRequest(entityName: "Constants")
  
      do {
          let results = try managedContext.executeFetchRequest(fetchRequest)
      } catch let error as NSError {
          print("Could not fetch \(error), \(error.userInfo)")
      }
  }
  </code></pre>
  
  <p>Within the entity <code>Constants</code> there are 4 attributes: <code>moneyPerSecondSave</code>,<code>moneySave</code>,<code>tapMultiplierSave</code>and<code>tapValueSave</code>.
  My question is, is there a way that after I have got the <code>results</code> can I make four variables which each hold each of the values of the attributes.</p>
  
  <p>I have already tried using <code>valueForKey</code>:</p>
  
  <pre><code>moneyConstants.money = results.valueForKey("moneySave")
  </code></pre>
  
  <p>However when I try this it pulls up an error: `Value of type '[AnyObject]' has no member 'valueForKey'. Any help would be appreciated.</p>