Bug 22886 - UIImage.FromBundle fails to find file with leading /
Summary: UIImage.FromBundle fails to find file with leading /
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-09-11 16:28 UTC by Cody Beyer (MSFT)
Modified: 2014-09-11 17:43 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Cody Beyer (MSFT) 2014-09-11 16:28:44 UTC
In existing Xamarin.iOS applications that implement UIImage.FromBundle the following code would find the image

SearchImage = UIImage.FromBundle (@"/Images/search_icon.png");

However, when targeting iOS 8, the image will not be found using the above code. The leading slash must be dropped, such that the code will be

SearchImage = UIImage.FromBundle (@"Images/search_icon.png");

Example case: https://xamarin.desk.com/agent/case/88367

Thank you.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2014-09-11 17:43:40 UTC
This has changed in iOS itself (the same thing happens in Xcode), so there's nothing we can do here.

My guess is that it's an intentional change from Apple, but you might want to ask in their forums.