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.
MonoTouch.UIKit.UICollectionView.DequeueReusableCell returns an NSObject, but:
- Xamarin docs say that it returns a UICollectionReusableView, and
- It is a binding of dequeueReusableCellWithReuseIdentifier:forIndexPath, which returns a UICollectionViewCell.
I would then expect it to return one of the types above and/or the documentation to be fixed (I'd prefer the former).
(by the way, similar method for tables, UITableView.DequeueReusableCell, returns a UITableViewCell)
Apple header file (and part of the documentation, e.g. the signature) shows it returns `(id)` which can be any NSObject. However it is later documented to be an `UICollectionReusableView` (sadly that was not reflected in the bindings).
OTOH changing the return type of a (public) method is a breaking change, i.e. any binary assembly (e.g. components) with a reference to this method would break if we change the definition.
note: `dequeueReusableSupplementaryViewOfKind:withReuseIdentifier:forIndexPath:` has the same issue.
I'll add comments in the bindings so if we ever need to break binary compatibility we can revisit that decision.
Then it would be good to update Xamarin.iOS docs so that it doesn't say it returns `UICollectionReusableView`.
comment added in e761c97a62ad1963cdc01d643c266728fe929e68
I'm not sure about the documentation as it's really a `UICollectionReusableView` that's being returned (even if the signature is a base class of it). IMO changing this to `NSObject` would be more confusing since that information will be totally lost (not in the signature, neither in the docs).
It's a bit like a method that return a List when the signature specify an IList (it's still useful to know what's actually returned).
c.c. Larry as he might have some better idea on how to document this.
This fix is planned to be released with Xamarin.iOS 7.0.6, which should hit the beta channel before December 23rd.
I have verified this issue and found that "NSOBject" return type of "MonoTouch.UIKit.UICollectionView.DequeueReusableCell" is mentioned in both Doc and monotouch assembly.
Refer Screenshot: "http://screencast.com/t/YFkrhKxsl"
MAC: MT 10.8.4
XS: 4.2.3 build(20)
X iOS: 220.127.116.11
*** Bug 18270 has been marked as a duplicate of this bug. ***