Search code examples
iosobjective-ccocoaios5nsdictionary

Case insensitive keys for NSDictionary


I am trying to utilize incase-sensitive case for JSON response on NSDictionary as sometimes my response keys type varies, some are camel case, some are lowercase or other mixed combination. Is there any built in functionality to check for in-sensitivity case for this case?

Thanks.


Solution

  • Lately I've shared two classes that might suit your needs. They provide case-insensitive operations (named after NSDictionary and NSMutableDictionary methods) while keeping the originally inserted keys.

    Give it a try:

    https://github.com/keeshux/ios-components/tree/master/Components/Utils/KSCIDictionary