Swift String no longer has access to NSString path related methods
| Originator: | davidahouse | ||
| Number: | rdar://22210643 | Date Originated: | 8/10/2015 |
| Status: | Open | Resolved: | No |
| Product: | Xcode | Product Version: | 7 Beta 5 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: As of Xcode 7 Beta 5, the Swift String class can no longer use built-in bridging to access the path related methods such as .pathComponents. In fact, all the methods/properties in the 'Working with Paths' section of NSString are NOT available to a Swift String class. The error given by the compiler is: 'stringByDeletingLastPathComponent' is unavailable: Use stringByDeletingLastPathComponent on NSString instead. This change was not listed in the Release Notes and frankly just picking and choosing which NSString methods/properties are available from a Swift String class seems arbitrary. If the bridging can handle a Swift String in place of NSString, then why would some things not be available? Steps to Reproduce: 1. Create a Swift String and attempt to use any of the path related methods/properties as listed under the 'Working with Paths' section of NSString documentation. Expected Results: Methods work exactly as they have up until Beta 5 Actual Results: Compiler returns an error that these methods/properties 'has been explicitly marked unavailable here'
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!