0

I've created an UIButton subclass and I need to get the path of the image that the button has. I can write self.path but not self.imageView.image.path Any idea?

1 Answer 1

0

I don't believe that you can get the path. If you look at the api docs for UIImage, you can instantiate with a file, but by the time you have an instance the file is gone and all that's still there is the NSData.

This wouldn't be very efficient, but if you know the candidate files that were used to create the image, then perhaps you could hash the NSData, and compare with a hash of the NSData on the UIButton's UIImage?

1
  • Thanks! I'll do it in a different way then. Commented Jan 13, 2013 at 14:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.