The following code works fine on iOS device and simulator, but fails in Xcode playground (run with iOS platform set in playground file inspector):
class ACertainStringAttribute: NSObject {}
NSMutableAttributedString(string: "Test", attributes: ["MyCustomAttribute" : ACertainStringAttribute()])
It builds and run perfectly on device, but in playground I get the following runtime error:
2015-11-15 11:49:08.808 Test[38055:1538435] -[__lldb_expr_154.ACertainStringAttribute encodeWithCoder:]: unrecognized selector sent to instance 0x7fbd69c074d0
Why is there this difference?
NSCodingprotocol.import Foundation), and tested in a new iOS Xcode project ran in simulator. Works in app, not on playground. Running on iOS 8.4