NSString's initWiithFormat:locale: should actually take a nullable NSLocale instead of id.

Originator:steipete
Number:rdar://23514447 Date Originated:12-Nov-2015 11:33 AM
Status:Open Resolved:
Product:iOS SDK Product Version:9.1
Classification:Other Bug Reproducible:Always
 
Summary:

```
NSString:
- (instancetype)initWithFormat:(NSString *)format locale:(nullable id)locale, ... NS_FORMAT_FUNCTION(1,3);
- (instancetype)initWithFormat:(NSString *)format locale:(nullable id)locale arguments:(va_list)argList NS_FORMAT_FUNCTION(1,0);
```

locale: only takes nil or NSLocale. Yet it is declared as id. 
This caused crashing bugs for us in iOS 9 because we used to send it a string, which now crashes. A stronger type would have prevented a lot of frustration for Apple Customers and us developers alike.

Thus my radar. Probably just an oversight.

Radar Reviewer: This is a documentation bug and as such there’s no point in making an example.

Comments


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!