add +[NSCalendar calendarWithIdentifier:]

This commit is contained in:
Graham Lee 2018-04-30 18:01:51 +01:00
parent 5c7713cacc
commit c5fac90b86
3 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2018-04-30 Graham Lee <graham@iamleeg.com>
* Source/NSCalendar.m (calendarWithIdentifier:):
New convenience method implemented by Cocoa.
2018-04-24 Richard Frith-Macdonald <rfm@gnu.org>
* configure: regenerate

View file

@ -259,6 +259,7 @@ enum
}
+ (id) currentCalendar;
+ (id) calendarWithIdentifier: (NSString *) string;
- (id) initWithCalendarIdentifier: (NSString *) string;
- (NSString *) calendarIdentifier;

View file

@ -252,6 +252,11 @@ static NSRecursiveLock *classLock = nil;
return self;
}
+ (id) calendarWithIdentifier: (NSString *) string
{
return [[[self alloc] initWithCalendarIdentifier: string] autorelease];
}
- (id) initWithCalendarIdentifier: (NSString *) string
{
NSAssert(0 == _NSCalendarInternal, NSInvalidArgumentException);