NSDictionary Iteration

As with any software solution, there are usually several ways to do the same thing. Iterating through NSDictionary on iOS certainly has it’s own set of ways.

iOs allows you to get all all the keys to dictionaries which can be iterated over:

Alternatively, iOS supports enumerators (similar to JAVA):

Dictionaries can also be directly iterated in single for-loop lines:

Or somewhat faster:

Or better yet, if your target OS supports blocks:

Tags: , , , , ,

Comments are closed.

Search

Websites

  • slide
  • slide
  • slide
  • slide