ISO8601
ISO8601 copied to clipboard
Can -ISO8601String ever be nil?
This library is great! One question: can NSDate -ISO8601String ever be nil?
It's marked __nullable, but I'm not sure I understand why. It calls -ISO8601StringWithTimeZone (also __nullable), which in turn calls +stringForDateComponents, which is __nullable. That method returns nil if !hasDate && !hasTime, which makes sense.
I understand why the string formatter for NSDateComponents has to check this, and therefore be nullable. But if it's being called on a converted NSDate, that's always going to have them, right?
I guess what I'm suggesting is either:
- NSDate
-ISO8601String(and its WithTimeZone variant) shouldn't be__nullable, or: - it should document in what case these can return nil (because unlike the parsers, or the NSDateComponents variants, it's not at all obvious)
Thanks!