What are some possible optimizations for NSDateFor

2019-08-06 05:52发布

I am currently profiling my iPhone application start-up in an attempt to get it to start as quickly as possible. In the first 19 seconds of my application being started I call NSDateFormatter's stringFromDate method 6 times with the following format string: @"h:mm a zzz"

The NSDateFormatter instance itself is shared by all calls and I only set the date format once, but those 6 calls to stringFromDate amount to 17.3% of my start-up CPU time.

Note: The dates are dynamic so I can't just save the strings.

Any suggestions as to how I could make this faster?

0条回答
登录 后发表回答