Merge pull request #22 from iamleeg/nscalendar-withIdentifier

add +[NSCalendar calendarWithIdentifier:]
This commit is contained in:
Fred Kiefer 2018-06-16 21:41:40 +02:00 committed by GitHub
commit 7716697a5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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-05-29 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSObject.m: avoid static initialisation macro for allocation

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);