I am seeing strange behavior where UIImage.FromFile is sometimes unable to locate an image in my app bundle. If I call this function from certain places in my code (for example ViewDidAppear of my main view controller) it correctly loads my image. If I call it anywhere else (for example ViewDidAppear of a view controller that I present later) it returns null, even though I'm calling it with the same image path.
Can anyone think of reasons this may be happening? I've tried the following, with no change in behavior:
I've tried the same thing from a simple test app created from scratch but it always works fine. But I haven't been able to figure out what's different about my production app.
My current workaround is to include images as EmbeddedResources and load them using NSData and GetManifestResourceStream, but that's not an ideal solution.