I would like to add an associative object to an NSDate
object. To do this, I use a method described here.
My problem is now that iOS does not (no longer?) create different NSDate objects for the same date (see here). Therefore, if I have two items with the same NSDate, I cannot differentiate the objects and my method for adding an associative object for a particular item fails.
I've tried different approaches:
- Using the
copy
method ofNSDate
NSDate *deepCopy = [[NSDate alloc] initWithTimeInterval:0 sinceDate:date];
NSDate *deepCopy = [date dateByAddingTimeInterval:0];
But the variables I named deepCopy
are not deep copies of the original date
object.
What can I do?