You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fatalError("This method is only implemented for coders which allowKeyedCoding.")
205
+
}
206
+
207
+
if requiresSecureCoding {
208
+
NSRequiresConcreteImplementation()
209
+
}else{
210
+
returndecodeObject(forKey: key)
211
+
}
203
212
}
204
213
214
+
// ----- Top-level decoding -----
215
+
216
+
/*
217
+
On Darwin, if a coder's .decodingFailurePolicy is .raiseException, ObjC exceptions are used to interrupt execution of your init(coder:) initializer when a failure occurs during decoding.
218
+
219
+
The …TopLevel… methods below are documented to:
220
+
- interrupt your init(coder:) execution and immediately unwind the stack if a decoding error occurs with your .decodingFailurePolicy set to .raiseException, and
221
+
- still return with a thrown error, and continue program execution.
222
+
223
+
This isn't possible in swift-corelibs-foundation, where ObjC exceptions are unavailable; either program execution is immediately interrupted, or an error is thrown, but not both. To port your code to swift-corelibs-foundations, use the replacements noted below.
224
+
*/
225
+
226
+
@available(*, unavailable, message:"The behavior of this method isn't supported in swift-corelibs-foundation. You can use decodeObject() instead on all platforms. If you would like an error to be thrown, use .decodingFailurePolicy = .setErrorAndReturn, and check the .error property.", renamed:"decodeObject()")
205
227
openfunc decodeTopLevelObject()throws->Any?{
206
-
NSUnimplemented()
228
+
NSUnsupported()
207
229
}
208
230
231
+
@available(*, unavailable, message:"The behavior of this method isn't supported in swift-corelibs-foundation. You can use decodeObject(forKey:) instead on all platforms. If you would like an error to be thrown, use .decodingFailurePolicy = .setErrorAndReturn, and check the .error property.", renamed:"decodeObject(forKey:)")
@available(*, unavailable, message:"The behavior of this method isn't supported in swift-corelibs-foundation. You can use decodeObject(of:forKey:) instead on all platforms. If you would like an error to be thrown, use .decodingFailurePolicy = .setErrorAndReturn, and check the .error property.", renamed:"decodeObject(of:forKey:)")
/// Decodes an top-level object for the key, restricted to the specified
@@ -225,10 +249,13 @@ open class NSCoder : NSObject {
225
249
/// - classes: An array of the expected classes.
226
250
/// - key: The code key.
227
251
/// - Returns: The decoded object.
252
+
@available(*, unavailable, message:"The behavior of this method isn't supported in swift-corelibs-foundation. You can use decodeObject(of:forKey:) instead on all platforms. If you would like an error to be thrown, use .decodingFailurePolicy = .setErrorAndReturn, and check the .error property.", renamed:"decodeObject(of:forKey:)")
0 commit comments