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.
This method enforces use on the UI thread with UIApplication.EnsureUIThread (), but why? Whats the problem with constructing one in a background thread exactly?
Full definition below:
[Export ("layoutAttributesForCellWithIndexPath:"), CompilerGenerated]
public static UICollectionViewLayoutAttributes CreateForCell (NSIndexPath indexPath)
if (indexPath == null)
throw new ArgumentNullException ("indexPath");
return (UICollectionViewLayoutAttributes)Runtime.GetNSObject (Messaging.IntPtr_objc_msgSend_IntPtr (UICollectionViewLayoutAttributes.class_ptr, UICollectionViewLayoutAttributes.selLayoutAttributesForCellWithIndexPath_, indexPath.Handle));
WIth a few exceptions UIKit code is not thread-safe.
As such all UIKit.* methods are, by default, calling EnsureUIThread to avoid running into hard to find and near-to-impossible to duplicate bugs caused by accessing UIKit structures from several threads.
If you find some Apple documentation about a specific API being thread-safe let us know and we'll update ou bindings to match this.
More details @ http://tirania.org/monomac/archive/2012/Sep-10.html including instruction on how you can, at your own risk, turn the feature completely or partially off.