Bug 21985 - Exception when calling Remove or IndexAt for ObservableCollection<Enum> on device (iPhone)
Summary: Exception when calling Remove or IndexAt for ObservableCollection<Enum> on de...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-10 19:57 UTC by Joseph Narai
Modified: 2014-09-08 10:04 UTC (History)
5 users (show)

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


Attachments
Copy of test project showing the issue (8.92 KB, application/zip)
2014-08-10 19:57 UTC, Joseph Narai
Details


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 Joseph Narai 2014-08-10 19:57:39 UTC
Created attachment 7650 [details]
Copy of test project showing the issue

Description of Problem:

I create a new ObservableCollection<Enum> ()

I can add to the collection, but when I try and call Remove() or IndexOf() with appropriate values, then I get:

Unable to cast object of type 'TestProj.TestProjViewController+SettingsSectionsEnum' to type 'System.Int32'.

Steps to reproduce the problem:
1. Run up test project, deploying to device (iPhone) - NOTE, it works as expected on simulator.
2. Exception will be throw at line 63 m_PutRequests.Remove (SettingsSectionsEnum.EmergencyEmail);

Actual Results:
Throws exception

Expected Results:
Correctly removes item from collection

How often does this happen? 
Always.

Additional Information:
I have attached a simple test project which displays the problem.
Comment 1 Udham Singh 2014-08-11 08:22:22 UTC
I have checked this issue and observed the same behaviour mentioned in bug description. To reproduce this issue I have followed the steps mentioned in bug description.

Screencast : http://www.screencast.com/t/oebktr9xAcu

Error Log : https://gist.github.com/Udham1/846243354a92f6e24879
Application Output : https://gist.github.com/Udham1/b761a215816e06e17f14
iOS Device Log : https://gist.github.com/Udham1/a0ecc6e42163fe1d6fcd
Ide Log : https://gist.github.com/Udham1/af41e735ffc67caf06c8

Environment Info : 

=== Xamarin Studio ===

Version 5.2 (build 386)
Installation UUID: 952292e8-1484-4c56-b664-6ff701bef591
Runtime:
	Mono 3.6.0 ((no/f540f8a)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000039

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 7.2.6.28 (Business Edition)
Hash: 606f31a
Branch: 
Build date: 2014-08-01 15:27:48-0400

=== Build Information ===

Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:03:28-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

=== Operating System ===

Mac OS X 10.9.3
Darwin Xamarin76s-Mac-mini.local 13.2.0 Darwin Kernel Version 13.2.0
    Thu Apr 17 23:03:13 PDT 2014
    root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Comment 2 Rolf Bjarne Kvinge [MSFT] 2014-09-08 10:04:49 UTC
This works fine with Xamarin.iOS 7.4.0.108.