Xcode-7 (7A120f): Can't add NSURLProtocol to `protocolClasses`
Originator: | me | ||
Number: | rdar://21314581 | Date Originated: | 09-Jun-2015 09:44 PM |
Status: | Open | Resolved: | |
Product: | Developer Tools | Product Version: | Xcode-7 (7A120f) |
Classification: | Serious Bug | Reproducible: | Always |
Summary: Trying to add a custom `NSURLProtocol` to a `NSURLSessionConfiguration` `protocolClasses` crashes at runtime. Steps to Reproduce: Add this to a storyboard: /// Where RecordingProtocol is just a subclass of `NSURLProtocol` RecordingProtocol.registerClass(RecordingProtocol) let configuration = self.defaultSessionConfiguration() configuration.protocolClasses?.insert(RecordingProtocol.self, atIndex: 0) return configuration Expected Results: Custom protocol gets added to the configuration instance and app keeps running. Actual Results: Protocol never gets added to the configuration instance and instead crashes with the following error: ``` fatal error: NSArray element failed to match the Swift Array Element type error: warning: got name from symbols: _XCDidPauseInDebugger error: assigning to 'void *' from incompatible type 'BOOL' (aka 'signed char') error: 1 errors parsing expression ``` Regression: This was possible in `Swift 1.x` (see http://github.com/esttorhe/Rec which holds a working function using `Swift 1.x`
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!