Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Internally this method calls NSString ctor. Here is the case where such behaviour is wrong.
* Read binary data (ex from picture.png)
* Pass NSData to FromData method. Exception here ...
From my point of view this is a correct workflow but incorrect result. An obj-c runtime return's nil from initWithData:encoding: and then NSString ctor can't create NSString from nil.
Here exception message:
> Could not initialize an instance of the type 'Foundation.NSString': the native 'initWithData:encoding:' method returned nil. It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.
FromData(NSData, NSStringEncoding) should returns null if NSData is not an actual string.
@Paola this is similar to the fix you did last week for AVFoundation. Please add a unit test :)
Fixed on maccore: 5e8de4de57a6cbf7eafbcd63d94ff8aee4a9a7f3
Unit test on monotouch: 37128c8258dbace75f068acea3b2a260189f1919