0

What would be the best way to assign a property to an existing class?

I have an existing array of ALAssets, and would like to assing a boolean as property to each asset. I could subclass, but then I have to copy each ALAsset into a new one (?) I can't create a category, because I need to store that boolean somewhere.

Any ideas?

marimba
  • 3,116
  • 5
  • 26
  • 29

1 Answers1

2

Associative references, available starting in OS X v10.6, simulate the addition of object instance variables to an existing class. Using associative references, you can add storage to an object without modifying the class declaration.

Associative References Documentation (developer.apple.com)

jatoben
  • 3,079
  • 15
  • 12