how I can get the NSDate of yesterday in iOS?
Thanks
Here is one way to do that:
NSDateComponents *components = [[[NSDateComponents alloc] init] autorelease];
[components setDay:-1];
NSDate *yesterday = [[NSCalendar currentCalendar] dateByAddingComponents:components toDate:[NSDate date] options:0];
Take a look at the Date and Time programming guide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With