title: Unrecognised selector error when adding UIImage to array
body: <p>I am storing a <code>UIImage</code> in a <code>NSDictionary</code>, and then passing the <code>NSDictionary</code> at another place in the app.  gridImages is a <code>NSMutableArray</code> </p>
  
  <pre><code>NSDictionary *pageDict = [pageArray objectAtIndex:0];
  
  UIImage *pageImage = [pageDict objectForKey:@"image"];
  
  [gridImages addObject:pageImage];
  </code></pre>
  
  <p>pagedict returns </p>
  
  <pre><code>{
      class = is;
      image = "&lt;UIImage: 0x14e20e10&gt;";
      name = kaka;
      page = 64;
  }
  </code></pre>
  
  <p>which presumably I do </p>
  
  <pre><code>UIImage *pageImage = [pageDict objectForKey:@"image"];
  </code></pre>
  
  <p>However, when I try to add that UIImage to an array, I get this error: </p>
  
  <pre><code>-[UIImage stringByDeletingPathExtension]: unrecognized selector sent to instance 0x14e20e10
  </code></pre>
  
  <p>Any idea whats going on?</p>
  
  <p>EDIT:</p>
  
  <p>For the <code>NSDictionary</code>, I tried storing the <code>UIImage</code> as <code>NSData</code>:</p>
  
  <pre><code>NSData *imageData = UIImagePNGRepresentation(textbookImage);
      [pageDict setObject:imageData forKey:@"image"];
      [pageDict setObject:textbookName forKey:@"name"];
      [pageDict setObject:page forKey:@"page"];
      [pageDict setObject:nameOfClass forKey:@"class"];
  </code></pre>
  
  <p>And the parsing it like this:</p>
  
  <pre><code>  NSData *imageData = [pageDict objectForKey:@"image"];
     UIImage *pageImage = [UIImage imageWithData:imageData];
  </code></pre>
  
  <p>But it still returns the same error</p>