Bug 9748 - UIImageView.set_HighlightedImage should accept null values
Summary: UIImageView.set_HighlightedImage should accept null values
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.0.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-01-23 18:39 UTC by Eric Fikus
Modified: 2013-01-23 20:29 UTC (History)
3 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Eric Fikus 2013-01-23 18:39:36 UTC
UIImageView.HighlightedImage = null throws an NRE, so there is no way to unset this value.

In objc highlightedImage = nil behaves as expected.
Comment 1 Sebastien Pouliot 2013-01-23 20:15:23 UTC
The [NullAllowed] attribute is present. OTOH when a binding is missing a [NullAllowed] it should be throwing an ANE (ArgumentNullException) not a NRE (NullReferenceException). 

Which version of MonoTouch are you using ?
Comment 2 Eric Fikus 2013-01-23 20:19:35 UTC
Oh, sorry, it is an ANE.  MT version 6.0.8.

[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Argument cannot be null.
Parameter name: value
  at MonoTouch.UIKit.UIImageView.set_HighlightedImage (MonoTouch.UIKit.UIImage value) [0x0000b] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIImageView.g.cs:239
Comment 3 Sebastien Pouliot 2013-01-23 20:29:03 UTC
It's fixed but it's not in 6.0.8 (or in 6.0.9) but it will be in 6.2 (and it's part of the 6.1 betas).

p.s. I can give you a workaround (manual binding) if this blocks you.