-1

I am creating one app in this I am giving start date and end date. I want to give local notifications for end date before one day. can you please help me for this.

Aditya
  • 15
  • 8
  • Possible duplicate of [how to create local notifications in iphone app](https://stackoverflow.com/questions/6047117/how-to-create-local-notifications-in-iphone-app) – Tamás Sengel Sep 28 '17 at 10:17
  • Welcome to Stack Overflow. Please review [How do I ask a good question](https://stackoverflow.com/help/how-to-ask). What have you already tried yourself to do this? This is not a coding-writing or tutoring service. Questions should show **evidence of research and attempts to solve the problem yourself**, a clear outline of your specific coding-related issue, and any relevant code in a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve), so we have enough information to be able to help. – FluffyKitten Oct 14 '17 at 02:14

1 Answers1

0

You can subtract a number of days by calling the dateByAddingTimeInterval method on your end date.

Like so:

NSDate *endDate = [NSDate date];
NSDate *fireDate = [fireDate dateByAddingTimeInterval:-1*24*60*60];  
animaonline
  • 3,715
  • 5
  • 30
  • 57