views:

30

answers:

2

In the "sample code" in iOS Dev Center there is a TableViewSuite. In the first example SimpleTableView the simulator provides a list of time zones by country. I can not find the list they are pulling from! it appears to be an array but I can't find the actual words that are coming up on the simulator screen in Xcode. I've learned about plists and dictionarys and Arrays and simply can't find where the names are coming from. I found this line:

// Retrieve the array of known time zone names, then sort the array and pass it to the root view controller.
NSArray *timeZones = [NSTimeZone knownTimeZoneNames];

rootViewController.timeZoneNames = [timeZones sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];

Again, where is it retrieving the information from? Thanks again.

+1  A: 

They're coming from this message:

[NSTimeZone knownTimeZoneNames]

Which is documented as such:

Returns an array of strings listing the IDs of all the time zones known to the system.

So essentially they're predefined somewhere in iOS and the names are simply being queried off the system.

BoltClock
Ahh! That makes sense. There must be many "known" items such as this. Thanks that was driving me crazy.
Andy Elliott
A: 

+[NSTimeZone knownTimeZoneNames] gets the list of time zones from the system itself. There is no list in the project.

Cory Kilger