title: NSData datawithcontentsoffile returns null
body: <p>i have below code for getting a file from iphone's documents directory:</p>
  
  <pre><code>NSString *docsDir;
  NSString *realpath;
  NSArray *dirPaths;
  dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  docsDir = dirPaths[0];
  
  realpath=[[NSString alloc] initWithString:
            [docsDir stringByAppendingPathComponent: @"2_program.db"]];
  NSFileManager *filemgr = [NSFileManager defaultManager];
  if ([filemgr fileExistsAtPath: realpath ] == YES)
  {
      NSLog(@"find file");
      NSData *uploadedData=[NSData dataWithContentsOfFile:realpath];
      NSString * uploadedDataBase64= [NSString base64forData:uploadedData];
      NSLog(@"base64: %@",uploadedDataBase64);
  }
  else
  {
      NSLog(@"not found");
  }
  </code></pre>
  
  <p>filemanager finds the file but nsdata returns null however both of them got the same path</p>
  
  <p>my file's size about 60kb</p>
  
  <p>any ideas why could it be happen? am i missing somthing?</p>