i Have 2 NSDate object the first is set to one month ahead and the seconed is set for today.
i want to check if today is after (Bigger) then the month ahead object.
How can i do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Read the Date and Time Programming Guide a lot of Date & Time concepts (and how Cocoa handle them) are explained here in details, it is really worth reading.
Also, in the NSDate class Reference, you can find a dedicated section “Comparing dates” for all the methods used to compare two dates. So you should use
laterDate:orearlierDate:methods that totally answer your question. You can also use thetimeIntervalSinceDate:method and check the sign of the returned time interval (see once again the documentation on this)In general, don’t hesitate to read the documentation as everything is already explained in there in detail as you can see given those links