Search code examples
iosswiftfoundationnstimezone

NSTimeZone initialisation results in "unable to read data"


I'm trying to initialise an NSTimeZone object like this:

var timezone = NSTimeZone.init(name: "Europe/Moscow")

instead of nil or a legit locale value - I get "unable to read data" in xCode's debugging tool

enter image description here

I got the timezone string ("Europe/Moscow") via NSTimeZone.knownTimeZoneNames()

I'm using xCode 7

What am I doing wrong?


Solution

  • As pointed out in the comments - the variables view was just wrong - a print() resulted in the correct output.

    Running an iPhone 6 Simulator instead of an iPhone 5 simulator gives the expected results.