Hi All,

The eventWithUID:occurrence: method of CalCalendarStore is not working for me 
as expected when retrieving a recurring event.  I am not sure if there is a 
disconnect between the documentation and the CalCalendarStore documentation or 
if perhaps there is something I am not seeing.

According to the documentation for the return value:

A CalEvent object that matches the specified unique identifier and date. 
Returns nil if the event is not found, or the event is recurring and date is 
not specified.


However - I am always getting back the first event of a recurring series if I 
give it the uid of a recurring event with out a date.  I am not getting back 
nil as I should be according to the documentation.

Here is some simple test code:

        CalCalendarStore * calStore = [CalCalendarStore defaultCalendarStore];
        
        NSDate * today = [NSDate date];
        NSDate * start = [today dateByAddingTimeInterval:(60*60*24)];
        NSDate * end = [today dateByAddingTimeInterval:(60*60*28)];
        
        
        NSPredicate * predicate = [CalCalendarStore 
eventPredicateWithStartDate:start endDate:end calendars:[calStore calendars]];
        
        NSArray * events = [calStore eventsWithPredicate:predicate];
        
        CalEvent * event = [events objectAtIndex:0];
        
        NSString * title = [event title];
        NSString * uid = [event uid];
        NSLog(@"%@ %@", title, uid);
        
        
        CalEvent * eventWithUID = nil;
        eventWithUID = [calStore eventWithUID:uid occurrence:nil];
        
        NSLog(@"Event is %@", eventWithUID);


In my case I am retrieving exactly one event of a recurring series.   
eventWithUID should be null - but it is not.  Is anyone familiar with this 
problem - and is this already a documented issue?  Or has my brain frozen over 
and perhaps there's something I'm not seeing or understanding properly?

Thanks!
Mazen Abdel-Rahman
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to