Bug 16335 - UiBarButtonItem doesn't allow null titles
Summary: UiBarButtonItem doesn't allow null titles
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.4.x
Hardware: All All
: Normal normal
Target Milestone: 7.0.6
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2013-11-19 05:24 UTC by Boris Scheiman
Modified: 2014-01-14 08:35 UTC (History)
4 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:
VERIFIED FIXED

Description Boris Scheiman 2013-11-19 05:24:30 UTC
Using UIBarButtonItem w/ the title constructor (ie, new
UIBarButtonItem("blah", Style.Plain, etc...)) w/ a null title results in an
ArgumentNullException, when the following is valid ObjC:

[[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain
target:nil action:nil];

Why is this? Bug or feature?
Comment 1 Boris Scheiman 2013-11-19 05:27:04 UTC
Forgot to mention: using the empty constructor and setting properties allows for a null title (setting all required properties but title and titleview)
Comment 2 Sebastien Pouliot 2013-11-19 08:52:38 UTC
It's an oversight, the [NullAllowed] attribute is missing from the bindings. I'll add them (looks like `UITabBarItem` suffers from the same) for future releases. Thanks for spotting (and reporting) this!
Comment 3 Sebastien Pouliot 2013-11-20 17:12:36 UTC
Fixed in master b35f07f14af84abf140eec5a926f0517fcf157fc
QA: unit tests added in the same revision
Comment 4 PJ 2013-12-11 18:45:47 UTC
This fix is planned to be released with Xamarin.iOS 7.0.6, which should hit the beta channel before December 23rd.
Comment 5 Prashant manu 2014-01-14 08:35:31 UTC
As Sebastien says unit tests were added in comment 3. changing the status of this issue to Verified.