I'm working on an app that is powered by a back-end API web service. There is an en开发者_开发技巧tity being used that has a few properties (such as name etc.) and it also has a time. The time is fixed in the sense its 10:00AM but its not date specific.
What do you think the best format would be for me to return this time from the API and be able to turn it into a set of NSDateComponents (NSHourCalendarUnit | NSMinuteCalendarUnit) easily and accurately.
You need an NSDateFormatter, from which you get an NSDate. Once you have the NSDate you can do what you want with it.
精彩评论