How to set reminder one year ahead using EventKit Framework

Im trying to set the start date 1 year in advance when adding an event using Eventkit Framework.

so far I have looked on SO, done a google search and tried

controller.event.startDate = [[[NSDate alloc] initWithTimeInterval: 525960];
controller.event.endDate= [[NSDate alloc] init];

I get an error saying NSDate declares the selector initWithTimeInterval

Answers


Do not do it as interval= 525960.

Instead use NSCalender and then manipulate by adding 1 to current year.

NSCalendar *calendar=[[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar] ;
NSDateComponents *components=[[NSDateComponents alloc] init] ;
components.year=1;
NSDate *newDate=[calendar dateByAddingComponents: components toDate:[NSDate date] options: 0];
NSLog(@"Next year : %@", newDate);

Need Your Help

Need to pass a List<model> to the Http Post in a Controller

c# asp.net-mvc-3

I am passing a List to the view. In the view I need to pass back that list. It includes an editable check box, which are the items I really need. All of the other fields displayed are for read only

mysql process cannot be stopped

mysql ubuntu percona

I have recently installed 5.5.28-29.2 Percona Server (GPL), Release 29.2 in a Ubuntu 12.04 OS Desktop. I have tried to stop the server using different methods:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.