Bug 36870 - [Xuni] Auto generated columns of XuniFlexGrid render in reversed order on iOS *simulator*
Summary: [Xuni] Auto generated columns of XuniFlexGrid render in reversed order on iOS...
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 9.2
Hardware: PC Mac OS
: Normal normal
Target Milestone: (C7)
Assignee: Manuel de la Peña [MSFT]
Depends on:
Reported: 2015-12-11 05:24 UTC by Susan
Modified: 2016-01-19 15:16 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

XuniFlexGrid sample for Xamarin.iOS (15.10 KB, application/zip)
2015-12-11 05:24 UTC, Susan
Image comparing the behavior on iOS simulator and device (610.45 KB, image/png)
2015-12-11 05:25 UTC, Susan

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:

Description Susan 2015-12-11 05:24:25 UTC
Created attachment 14246 [details]
XuniFlexGrid sample for Xamarin.iOS

When XuniFlexGrid for Xamarin.iOS is deployed on iOS simulator, the auto generated columns are shown in reverse order compared to the actual binding datasource.
Please see the attached image, img_GeneratedCols, for reference.
Note: Auto generated columns rendered in correct order when the same grid is deployed on iOS real device*.

Steps to reproduce:
1. Open the attached sample, XuniFlexGridSample, with VS2015 and restore the missing Xuni packages build 60 from http://nuget.grapecity.com/nuget/
2. Deploy the app on iOS simulator
Actual Result:
Columns are rendered in reverse order as of the actual binding datasource.
Expected Result:
Columns are rendered in correct order as of the actual binding datasource and as on iOS real device.

Build Date & Hardware: Build 12/11/2015 on Win10 x64 (NovUpdate) + VS2015 Update1 and deploy on OS X El Capitan 10.11.2 + iOS 9.2 Simulator*

Additional Builds and Platforms: Doesn't Occur On Build 12/11/2015 on above same environment with iOS 9.2 Device*
Comment 1 Susan 2015-12-11 05:25:39 UTC
Created attachment 14247 [details]
Image comparing the behavior on iOS simulator and device
Comment 2 Susan 2015-12-11 06:40:23 UTC
Different implementations of basic libraries for iOS and Simulator cause that properties are index in reversed order on simulator
Comment 3 Manuel de la Peña [MSFT] 2016-01-11 09:43:00 UTC

AFAIK there are no differences between the basic libs used in the simulator and those in the the real devices. I have created a small project that uses reflection to detect the properties in a class and expose them via a Console.WriteLine and the values DO appear in the same order.

I'm going to contact the component developer to confirm what algorithm is used to generate the columns and write a test to confirm the bug.
Comment 4 Manuel de la Peña [MSFT] 2016-01-12 11:01:04 UTC

In order to be able to see the same behaviour in the simulator and in the device you must ensure that the same registrar is used. Basically, there are two different types of registrars, dynamic and static. 

Dynamic: It does the obj registration with objc and runtime, is faster to build but slower to start.

Static: It does the registration at compiler time.

The dynamic registrar is used on the desktop and the simulator.

Because there is no specification about the order in which the properties has to be exposed, the dynamic and static registrars are using different orders (class_copyPropertyList does no specify the order).

To see the exact same behaviour you can pass --registrar:static to the build options of the project and you will see the exact same behaviour in both, the simulator and the device. 

At the time of this response, we will not changing the registrars to expose the properties in the same way since the "work around" is easy enough for the user to implement.
Comment 5 Susan 2016-01-19 07:04:59 UTC

Thanks for your attention and response.
I'll forward your feedback to our development team.
Comment 6 Manuel de la Peña [MSFT] 2016-01-19 15:16:31 UTC

FYI I have also contacted ComponentOne to let them know about this bug in order for them to tackle it or at least be clear about it in the documentation.