On Sat, Feb 19, 2011 at 1:16 PM, Jim Thomason <[email protected]> wrote: > static NSCalendar* gmtCalendar = nil; > -(NSCalendar*) gmtCalendar { > @synchronized(self) { > if (gmtCalendar == nil) { > NSLog(@"NEEDS NEW GMT!"); > NSCalendar* newGMTCalendar = [[NSCalendar alloc] > initWithCalendarIdentifier:NSGregorianCalendar]; > [newGMTCalendar setTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]]; > gmtCalendar = newGMTCalendar; > } > } > return gmtCalendar; > }
Is this method called from different threads? NSCalendar is thread-unsafe (not to be shared across threads): http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html _______________________________________________ Cocoa-dev mailing list ([email protected]) 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 [email protected]
