PDA

View Full Version : NSCalendar ??




sujithkrishnan
Aug 25, 2008, 10:01 AM
Hi

In my app, i want to do a specific task on tuesday on app startup.
If the app not opened on tuesday, i want the action to perform on the day which user opens the app.

I tried making use of NSCalendar, but not much helpful... How to get the Date of last Tuesday if i on a later day ??

I think i want to make use of "dateByAddingComponents" with some negative values....

i found the NSCalendarDate can help me out, But it is not in iPhone Library... i think (as per API ref)



davedelong
Aug 25, 2008, 10:17 AM
The NSDate (http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class) class is available on iPhone. That should have the functionality you're looking for.

HTH,

Dave