Store NSTimeZone in Core Data

299 views Asked by At

I tried to save NSTimeZone as transformable type, but it doesn't work seems due to it conforms to NSSecureCoding.

Is it any other alternatives?

1

There are 1 answers

1
Dave DeLong On BEST ANSWER

If the TimeZone has a defined name, you can store that as a string. It may not have a name if you manually constructed the timeZone based off a GMT offset.

... So you could store the GMT offset if you wanted, but then you would lose any of the DST information associated with a named timezone.

Probably the best way is to store the data. That should contain the information necessary to reconstruct the appropriate NSTimeZone instance.