The locale object must contain more information than apple talks about in the documentation. i.e. it must contain several date format strings. How can I print all this stuff to see where they are? Is there a method that would print out all information about an object?
A:
Why do you believe the NS/CFLocale
object has date format strings in it? I would assume these strings are stored in the NSDateFormatter
class, probably as static data rather than instance data. Just my guess, but based on my experience with NSCalendar
.
Rob Napier
2009-08-30 03:42:14
isn't the locale the thing that contains all this cultural information? it's a little diverting.
HelloMoon
2009-08-30 07:53:36
The Locale contains the the identifier for the current locale. It would be reasonable for NSDateFormatter uses that identifier to determine the correct culture information related to date formats. My experience suggests that the latter is how it's implemented, which is why you can't easily create new Locales. Again, there might be a date format in there, but I don't see one in a memory dump of the object, and I have no reason to believe that it's implemented that way (and then hidden from us in private methods).
Rob Napier
2009-08-30 13:44:49