過去にObjective-CでNSCalendarクラスとNSDateComponentsクラスを使って、以下のような現在の年度をNSNumber型で取得するメソッドがありました。このメソッドを - (NSNumber*)yearNumber { NSCalendar* gregorian = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease]; NSDateComponents* comp = [gregorian components:NSYearCalendarUnit fromDate:[NSDate date]]; return [NSNumber numberWithInteger:comp.year]; } iOS 8 SDKを使ってビルドをすると、下記のようなワー