You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am parsing a BSON message to an NSDictionary. The BSON has an array like this:
{
Data = "some data"; // all strings are String (not CString)
Name = "my name";
Things = ( "thing1", "thing2" ); // an array of Strings
},{
Data = "more data";
Name = "another name";
Things = ( "thing3", "thing4" );
}
This works fine converting the BSON to NSDictionary. But when Name is an empty string (not nil—I know that breaks NSDictionary), the "Things" array that comes after it in the BSON structure doesn't get added to the dictionary:
{
Data = "more data";
Name = "";
}
Though the array IS in the BSON. Just changing the Name field to be a space (if it would otherwise be empty) makes the Things array show up again in the output NSDictionary.
Also, if I change the order of the elements so that Things comes before Name, then Things is retained even when Name is an empty string. So order counts here.
The text was updated successfully, but these errors were encountered:
I am parsing a BSON message to an NSDictionary. The BSON has an array like this:
{
Data = "some data"; // all strings are String (not CString)
Name = "my name";
Things = ( "thing1", "thing2" ); // an array of Strings
},{
Data = "more data";
Name = "another name";
Things = ( "thing3", "thing4" );
}
This works fine converting the BSON to NSDictionary. But when Name is an empty string (not nil—I know that breaks NSDictionary), the "Things" array that comes after it in the BSON structure doesn't get added to the dictionary:
{
Data = "more data";
Name = "";
}
Though the array IS in the BSON. Just changing the Name field to be a space (if it would otherwise be empty) makes the Things array show up again in the output NSDictionary.
Also, if I change the order of the elements so that Things comes before Name, then Things is retained even when Name is an empty string. So order counts here.
The text was updated successfully, but these errors were encountered: