Skip to content

This library provides OrderedDictionary and MutableOrderedDictionary subclasses.

License

Notifications You must be signed in to change notification settings

akashgupta88/OrderedDictionary

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

The order of objects stored in an NSDictionary is undefined. Often it is useful to be able to loop through a set of key/value pairs and have the objects returned in the order in which they were inserted. This library provides two classes, OrderedDictionary and MutableOrderedDictionary that implement that behaviour.

Supported OS & SDK Versions

  • Supported build target - iOS 7.1 / Mac OS 10.9 (Xcode 5.1, Apple LLVM compiler 5.1)
  • Earliest supported deployment target - iOS 5.0 / Mac OS 10.7
  • Earliest compatible deployment target - iOS 4.3 / Mac OS 10.6

NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this OS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly.

ARC Compatibility

OrderedDictionary requires ARC. If you wish to use OrderedDictionary in a non-ARC project, just add the -fobjc-arc compiler flag to the OrderedDictionary.m class. To do this, go to the Build Phases tab in your target settings, open the Compile Sources group, double-click OrderedDictionary.m in the list and type -fobjc-arc into the popover.

If you wish to convert your whole project to ARC, comment out the #error line in OrderedDictionary.m, then run the Edit > Refactor > Convert to Objective-C ARC... tool in Xcode and make sure all files that you wish to use ARC for (including OrderedDictionary.m) are checked.

Thread Safety

Access to an OrderedDictionary is inherently thread safe because it is immutable. Access to a MutableOrderedDictionary is not thread safe unless you ensure that no thread attempts to read from the dictionary whilst another is writing to it.

Installation

To install OrderedDictionary into your app, drag the OrderedDictionary.h and .m files into your project.

Release Notes

Version 1.1.1

  • Added enumerateKeysAndObjectsWithIndexUsingBlock: method
  • Now conforms to -Weverything warning level

Version 1.1

  • Now requires ARC
  • Updated to remove warnings in latest iOS
  • Removed OrderedMutableDictionary variant
  • Now complies to -Wextra warning level
  • Added podspec

Version 1.0

  • Initial release

About

This library provides OrderedDictionary and MutableOrderedDictionary subclasses.

Resources

License

Stars

Watchers

Forks

Packages

No packages published