NSObject+AssociatedDictionary 1.0.0

NSObject+AssociatedDictionary 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2014

Maintained by Unclaimed.


Downloads

Total22,910
Week0
Month0

Installs

Apps34
Test Targets8
Watch Apps1
powered by Segment

GitHub

Stars7
Watchers1
Forks2
Issues0
Contributors1
Pull Requests0

Code

Files2
LOCLines of Code 19


  • By
  • Vikram Kriplaney

A light-weight Objective-C category that adds a mutable dictionary for arbitrary, ad-hoc properties that can be associated with any object. The dictionary, called properties, is created just-in-time (the first time it's accessed).

For any object, you can now set an ad-hoc property without prior declaration:

self.properties[@"someKey"] = someObject;

Ever wished you could do this without subclassing? Now you can:

myButton.properties[@"confirmationMessage"] = @"Are you sure you want to do this?";