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
if (![list isKindOfClass:[NSArray class]])
{
// if 'list' isn't an array, we create a new array containing our object
list = [NSArray arrayWithObject:list];
}
And when the array has only one object, everything works fine
I have an object c code connecting to a web server returning an xml.
after, I put the result into an NSDictionary:
self.xmlDictionary = [XMLReader dictionaryForXMLString:self.theXML options:XMLReaderOptionsProcessNamespaces error:&parseError];
NSLog(@"%@", self.xmlDictionary);
If my JSON returns more than 1 object my code counts the objects perfectly. But if my JSON returns only ONE object it miscounts.
My guess is the parenthesis are not inserted when only one value is returned.
Check my stack with complete code please:
http://stackoverflow.com/questions/33659623/objective-c-miscounting-array-with-json
The text was updated successfully, but these errors were encountered: