Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 13th, 2013  |  syntax: None  |  size: 0.58 KB  |  views: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. [_IDBanners addObject:@"44"];
  2.             NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  3.             NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory
  4.             NSString * name = [NSString stringWithFormat:@"%@.png",[_IDBanners objectAtIndex:i]];
  5.             NSString *filePath = [documentsPath stringByAppendingPathComponent:name]; //Add the file name
  6.  
  7.             NSData *pngData = [NSData dataWithContentsOfFile:filePath];
  8.             UIImage *image = [UIImage imageWithData:pngData];
  9.        
  10. NSLog(@"%@",image);