开发者

how do I store a day-of-week and time-of-day in objective-c?

how do I store a day-of-week and time-of-day in objective-c?

i.e. the equivalent of WED's at 7.30pm for example

Is there one specific objective-c object that w开发者_如何学Pythonould do this?


NSDateComponents would be a good start, but an instance of NSDateComponents only makes sense in the context of a particular NSCalendar instance, so you'll want to look into that class, too. Those classes are used together to construct (and deconstruct) NSDate objects.


Wouldn't NSDate work for your case?

It's the ObjectiveC answer to all problems related to date/time manipulation. Check the documentation, you should either find a method/constructor/... suitable for your case or use NSDateFormatter, for NSString<->NSDate conversions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜