NSUInteger count = [bills count]; // top-level elements in the dictionary
If you want to get ALL items, you need to use the enumeration of blocks and ask each dictionary recursively about what an account is, and then summarize. You must write the code - there is no method provided by the system for this. Look at the block enumerations (i.e. list ....) in the class reference.
you can also ask each element what it is, and if "isKindOf:" is NSDictionary or NSArray, get a counter, otherwise treat it as 1.
source share