title: Problem in fetching from core data to array
body: <p>In my core date in the entity name called Event and in that there is an attribute called "name". I want to fetch all the values of term from coredata to an nsarray. I used the below code and it is not working. Anybody please helpp.</p>
  
  <pre><code>NSFetchRequest *request = [[NSFetchRequest alloc] init];
  
  [request setEntity:[NSEntityDescription entityForName:@"Event" inManagedObjectContext:managedObjectContext]];
  
  NSError *error = nil;
  NSArray *events = [managedObjectContext executeFetchRequest:request error:&amp;error];
  NSAssert2(events != nil &amp;&amp; error == nil, @"Error fetching events: %@\n%@", [error localizedDescription], [error userInfo]);
  NSMutableArray *namesArray = [[NSMutableArray alloc]init];
  namesArray = [events valueForKey:@"name"];
  </code></pre>