parsing calander events
===

In my application I am retrieving all calender events using eventkit framework. Now I have parse it in to json to upload it to server. what is the best way to do this, kindly give me an idea if there are any parser libraries or framework which can parse calendar events. Below is the code i used to retrieve events 


    - (NSMutableArray *)fetchallevents {
	
	
	NSDate *start = [NSDate distantPast];    
      NSLog(@"start date is : %@",start);
    
    NSDate *finish = [NSDate distantFuture];
    NSLog(@"start date is : %@",finish);
		// use Dictionary for remove duplicates produced by events covered more one  year segment
	NSMutableDictionary *eventsDict = [NSMutableDictionary dictionaryWithCapacity:1024];
	
	NSDate* currentStart = [NSDate dateWithTimeInterval:0 sinceDate:start];
	
	int seconds_in_year = 60*60*24*365;
	
		// enumerate events by one year segment because iOS do not support predicate longer than 4 year !
	while ([currentStart compare:finish] == NSOrderedAscending) {
		
		NSDate* currentFinish = [NSDate dateWithTimeInterval:seconds_in_year sinceDate:currentStart];
		
		if ([currentFinish compare:finish] == NSOrderedDescending) {
			currentFinish = [NSDate dateWithTimeInterval:0 sinceDate:finish];
		}
		NSPredicate *predicate = [eventStore predicateForEventsWithStartDate:currentStart endDate:currentFinish calendars:nil];
		[eventStore enumerateEventsMatchingPredicate:predicate
										  usingBlock:^(EKEvent *event, BOOL *stop) {
											  
											  if (event) {
												  [eventsDict setObject:event forKey:event.eventIdentifier];											  }  }];       
		currentStart = [NSDate dateWithTimeInterval:(seconds_in_year + 1)  sinceDate:currentStart];
		
	}	
	NSMutableArray *events =[[eventsDict allValues]mutableCopy];  
     //NSLog(@"the evenets for the day is : %@", events);	

    return events;
	
    }

