title: Swift: Fetch CoreData as Array
body: <p>I want to fetch all Saved Data in the sqlite table.</p>
  
  <p>I'm currently doing this:</p>
  
  <pre><code> func GetAllData() -&gt; NSArray
  {
      var error : NSError? = nil;
      var request : NSFetchRequest = NSFetchRequest(entityName: "Locations");
      let result : [AnyObject] = managedObjectContext!.executeFetchRequest(request, error:&amp;error)!;
        var elements : NSMutableArray = NSMutableArray();
      for fetchedObject in result
      {
          elements.addObject(fetchedObject[0]);
      }
      print(elements);
      return elements;
  }
  </code></pre>
  
  <p>I have no problems to fetch Data in Objective-C but in swift I dont get it!</p>
  
  <p>The saving of the data works fine. I have two rows "Name" and "Category". How can I show all saved data?</p>