How can I find out what the image name (usually file name?) loaded into a UIImage instance is? In this case, they were all initWithContentsOfFile:
.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
It's also something you can't just add a category on UIImage to, unfortunately, because it requires state.
If you already know what the image names are you can compare your image to another image using image named:
Here I use one button to switch between two images.
Once it's loaded using that, you can't. The file name is only used to load the data into memory. After that, it becomes irrelevant.
If you need to maintain the file name, then perhaps you need to make a class with the filename (as an
NSString
orNSURL
, perhaps) and the image data (as anNSImage
orNSData
object) as ivars. I'm not sure what your application is, so I can't give you any architectural advice at this point.