Check to see if NSDate holds a date or is empty
iphone, nsdate, objective-c
Solution
If you want to see if an instance of `NSDate` (or any object) is nil, just compare it to nil. A non-null `NSDate` object will never be empty; it always contains a date. Both `-init` and `+date` return an `NSDate` object initialized to the current date and time, and there is no other way to create an instance of this class.
if(someData == nil) {
// do stuff
}
Problem
What would be the best way to see if an NSDate is actually set to a date or is empty? Returning its description or changing it to string returns "(null)"...? Thanks.