I am trying to convert a Dictionary to NSDictionary.
document = NSDictionary\<string, object\>(); // with some data of course
The way I am doing this is:
NSDictionary<NSString, NSObject> iosDoc = NSDictionary<NSString, NSObject>.FromObjectsAndKeys(
document.Values.ToArray(),
document.Keys.ToArray()
);
And the error I get is the following:
Error CS1061: 'Dictionary<string, object>.ValueCollection' does not contain a definition for 'ToArray' and no accessible extension method 'ToArray' accepting a first argument of type 'Dictionary<string, object>.ValueCollection' could be found (are you missing a using directive or an assembly reference?) (CS1061)
Error CS1061: 'Dictionary<string, object>.KeyCollection' does not contain a definition for 'ToArray' and no accessible extension method 'ToArray' accepting a first argument of type 'Dictionary<string, object>.KeyCollection' could be found (are you missing a using directive or an assembly reference?) (CS1061)
This has worked in a previous project and Visual Studio recognises this method but the code doesn't compile.
Any ideas?
using System.Linq;
in your using statements? – Jasonusing System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Firebase.Auth; using Firebase.CloudFirestore; using Foundation;
– Liam Kenny