(NS)ByteCountFormatter is missing a locale property
||Date Originated:||08-Mar-2017 03:19 PM|
|Product:||iOS + SDK
||Product Version:||iOS 10.3|
All common formatters (e.g. (NS)DateFormatter, (NS)NumberFormatter) provide a locale property with which a locale can be specified in which the formatter should format the input. (NS)ByteCountFormatter is missing such a property.
Since usually all formatters need to format in a specific locale, it would probably the simplest to add such a property to the common (NS)Formatter superclass.
Steps to Reproduce:
1. Create an iOS project
2. Create an (NS)ByteCountFormatter instance.
3. Try to format a string in a locale which differs from the system locale (e.g. by setting the locale property)
There is a property on the (NS)ByteCountFormatter instance for the locale that is used.
No locale property is present and there is no way to tell the (NS)ByteCountFormatter which locale it should use. It will always default to the system locale.
Since (NS)ByteCountFormatter most likely uses an (NS)NumberFormatter internally (Linux Foundation does at least), it could also be an option to expose this instance. However, this could also cause a lot of other problems since properties on (NS)NumberFormatter could be changed, that would result in faulty formatting of byte counts.
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!