title: Playing video from NSData stored in Core Data
body: <p>I am trying to play a video stored in Core data. After fetch it shows, there is an object and objects.video returns a value but the dataString prints out to be null. I am not sure what I maybe doing wrong. Is it a right way to play video or is there something I could have done better?</p>
  
  <p>I have single object in Core Data.</p>
  
  <p>I have stored as video as NSData in Core data. I want to get that stored video and play. Is there any other way I can do it?</p>
  
  <pre><code>_context =  [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
  NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
  NSEntityDescription *entity = [NSEntityDescription entityForName:@"Activity" inManagedObjectContext:_context];
  [fetchRequest setEntity:entity];
  // Specify how the fetched objects should be sorted
  NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"level"
                                                                 ascending:YES];
  [fetchRequest setSortDescriptors:[NSArray arrayWithObjects:sortDescriptor, nil]];
  
  
  NSError *error = nil;
  NSArray *fetchResults = [_context executeFetchRequest : fetchRequest error : &amp;error];
  if(fetchRequest == nil){
      NSLog(@"Nothing fetched");
  }
  
  
  for (Activity *objects in fetchResults){
  
      NSLog(@"%@",objects.video);
    prints-&gt;  External Data Reference: &lt;self = 0x7bf48750 ; path = FF54B18E-10B3-4B04-81D4-55AC5E2141B9 ; length = 504426&gt;
  
  
  NSString *dataString = [[NSString alloc] initWithData:objects.video encoding:NSUTF8StringEncoding];
      NSLog(@"%@",dataString);
      NSURL *movieURL = [NSURL URLWithString:dataString];
      NSLog(@"%@",movieURL);
      _moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
      [_moviePlayer.view setFrame:CGRectMake (20, 20, 200 , self.view.bounds.size.height/2)];
      [self.view addSubview:_moviePlayer.view];
      [_moviePlayer play];
  
  }
  NSLog(@"%i",fetchResults.count);
  </code></pre>