I need to sort I need to subclass NSDate to add a tag, I don’t need to change its behaviour, do I still need to implement my own:
-
(NSTimeInterval)timeIntervalSinceReferenceDate
-
(id)initWithTimeIntervalSinceReferenceDate:(NSTimeInterval)seconds;
as stated in apple’s documentation? If so, how do I do it?
currently I just created a class extends NSDate with a tag attribute, but how do I initialise it?
Thanks!
NSDate is a class cluster, not a simple class. It is not wise to subclass a class cluster unless you know exactly what you are doing; see How do I subclass NSDate?
I would recommend that you create your own class containing an NSDate and a tag, and extend as needed:
Add the appropriate properties, etc for easy dot-notation access.