开发者

component year in objective-c always returns me 0001

i need to get the actual year, only the year bu开发者_如何学编程t when i search for the result, i get always 0001. why is it?

with the component i can get the day and the month.


no ok ok... i've solved putting a variable:

unsigned int unitFlags = NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit;

and assigning it to the components in the NSDatecomponents object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜