(NS)ByteCountFormatter is missing a locale property

Number:rdar://30919856 Date Originated:08-Mar-2017 03:19 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 10.3
Classification:Foundation Reproducible:Always

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)

Expected Results:
There is a property on the (NS)ByteCountFormatter instance for the locale that is used.

Actual Results:
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.

iOS 10.3

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.

Any Device


Duplicate of rdar://23304514

Apple Developer Relations

Engineering has determined that your bug report is a duplicate of another issue and will be closed.

The open or closed status of the original bug report your issue was duplicated to appears in the yellow "Duplicate of XXXXXXXX" section of the bug reporter user interface. This section appears near the top of the right column's bug detail view just under the bug number, title, state, product and rank.

If you have any questions or concerns, please update your report directly here: http://bugreport.apple.com/.

By mdf.friedrich at March 14, 2017, 6:17 a.m. (reply...)

Please note: 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!