Monday, May 23, 2011

NSCalendar currentCalendar example objc

You can get current calendar in your locale by calling [NSCalendar currentCalendar] method. The returned calendar is formed from the settings for the current user’s chosen system locale overlaid with any custom settings the user has specified in System Preferences. Settings you get from this calendar do not change as System Preferences are changed, so that your operations are consistent (contrast with autoupdatingCurrentCalendar). [NSCalendar currentCalendar example]

Example - [NSCalendar currentCalendar]

    NSCalendar          *calendar = [NSCalendar currentCalendar];