Bug 39993 - Getting value from NSMutableDictionary returns null if key and value are same
Summary: Getting value from NSMutableDictionary returns null if key and value are same
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 9.6 (iOS 9.3)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-30 14:25 UTC by kevin.hicks
Modified: 2016-06-23 14:08 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:
RESOLVED NORESPONSE

Description kevin.hicks 2016-03-30 14:25:07 UTC
Overview:
    On iOS 9.3, retrieving value from NSMutableDictionary returns null when key and value contain the same value.

Steps to Reproduce: 
	Add the following to an iOS project, and run on a device running iOS 9.3.

		NSMutableDictionary testDict = new NSMutableDictionary ();
		testDict.Add ((NSString)"Key1", (NSString)"Key1");
		testDict.Add ((NSString)"Key2", (NSString)"KeyTest2");
		Console.WriteLine ("Key1 contains " + testDict ["Key1"]);
		Console.WriteLine ("Key2 contains " + testDict ["Key2"]);

Actual Results:
	The value for Key1 was not returned, and null was returned instead.

	2016-03-30 09:38:13.892 MyAppiOS[345:116685] Key1 contains 
	2016-03-30 09:38:13.893 MyAppiOS[345:116685] Key2 contains KeyTest2

Expected Results: 
	The value for Key1 should be returned.

	2016-03-30 09:38:13.892 MyAppiOS[345:116685] Key1 contains Key1
	2016-03-30 09:38:13.893 MyAppiOS[345:116685] Key2 contains KeyTest2

Build Date & Hardware: 
	Xamarin Studio 5.10.3 (build 27)
	Xamarin.iOS 9.6.0.0
	Occurs on iPad Air and iPad Mini, both running iOS 9.3.

Additional Builds and Platforms: 
	Does NOT occur on iPad 3 running iOS 8.4.1.
Comment 1 Sebastien Pouliot 2016-03-31 02:09:02 UTC
This works fine on my iOS 9.3 devices so your problem might be elsewhere.

[Test]
public void Bug39993 ()
{
	using (NSMutableDictionary testDict = new NSMutableDictionary ()) {
		testDict.Add ((NSString) "Key1", (NSString) "Key1");
		testDict.Add ((NSString) "Key2", (NSString) "KeyTest2");
		Assert.NotNull (testDict ["Key1"], "Key1");
		Assert.NotNull (testDict ["Key2"], "Key2");
	}
}

It's very uncommon to have such issues on specific iOS versions (unless it's an iOS bug win 9.3 but this case seems quite unlikely).

Please attach a small, self-contained, test case that shows the problem and we'll look at this again. If that cannot be reproduced in a smaller test case then the issue is likely elsewhere.
Comment 2 Manuel de la Peña [MSFT] 2016-06-23 14:07:32 UTC
We have not received the requested information. If you are still 
experiencing this issue please provide all the requested information 
and re-open the bug report. Thanks!
Comment 3 Manuel de la Peña [MSFT] 2016-06-23 14:08:15 UTC
Setting to resolve until we get info.