title: Load the resource after downloading(ios)
body: <p>I am downloading the resources from server and writing it to the documents directory successfully by using this code below</p>
  
  <pre><code>NSString *fileName = [[[NSURL URLWithString:url] path] lastPathComponent];
  
  NSArray *pathArr = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *folder = [pathArr objectAtIndex:0];
  
  NSString *filePath = [folder stringByAppendingPathComponent:fileName];
  NSURL *fileURL = [NSURL fileURLWithPath:filePath];
  NSLog(@"File written");
  
  NSError *writeError = nil;
  
  [webData writeToURL: fileURL options:0 error:&amp;writeError];
  if( writeError) {
      NSLog(@" Error in writing file %@' : \n %@ ", filePath , writeError );
      return;
  }
  NSLog(@"%@",fileURL);
  </code></pre>
  
  <p>Now I want to access those files to use it.I have tried this code</p>
  
  <pre><code>-(UIImage *) loadImage:(NSString *)fileName ofType:(NSString *)extension inDirectory:(NSString *)directoryPath
  {
  
     UIImage * result = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.%@", directoryPath, fileName, extension]];
     return result;
  }
  </code></pre>
  
  <p>Now method used is like this:</p>
  
  <pre><code>UIImage *imageFromWeb = [self loadImage:@"metaioman" ofType:@"png" inDirectory:folder];
  
  _imgview.image=imageFromWeb;
  </code></pre>
  
  <p>But no luck...please help</p>
  
  <p>Thank you</p>