nskeyedunarchiver Questions

0

req = ["a":nil, "b":3, "c":["d":3.3, "e":"e", "f":[]], "g":[]] Traditionally ("if js can do it we can do it too...
Circulation asked 1/7, 2024 at 18:51

3

Solved

iOS 16.4 deprecates unarchiveTopLevelObjectWithData(_:) and should be replaced with unarchivedObject(ofClass:from:). When you archived a Swift Dictionary like [String: Any], how do you use the newe...
Plunder asked 3/3, 2023 at 21:31

5

Solved

I have a working code that works but deprecated: This part is fine: let archived = try? NSKeyedArchiver.archivedData(withRootObject: [defaultRecord] as NSArray, requiringSecureCoding: false) ...
Rabush asked 4/5, 2019 at 11:54

7

Solved

Since upgrading to Swift 4.2 I've found that many of the NSKeyedUnarchiver and NSKeyedArchiver methods have been deprecated and we must now use the type method static func unarchivedObject<Decod...
Tracee asked 23/7, 2018 at 21:47

4

I got the following codes on writing an object named Packet and send to the other side through Multipeer connectivity. However, I got the following error whenever it try to decode the encoded objec...

0

I'm implementing the App Auth library in my iOS app, and trying to clean up a couple warnings when archiving the Auth State. 'unarchiveObject(with:)' was deprecated in iOS 12.0: Use +unarchivedObje...
Hemolysis asked 2/10, 2020 at 19:52

6

Solved

I just renamed my Xcode project and when I ran it I got this error: 2015-11-14 05:32:42.337 Buck Tracker[3537:1456100] * Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationExc...
Dextrin asked 13/11, 2015 at 21:38

4

I have added category methods to NSUserDefaults to store and retrieve encoded objects (in this case, an NSArray). I am having a problem retrieving the encoded data. Here is my code: - (void)encode...
Methedrine asked 21/9, 2018 at 12:20

0

Whenever I open an emacs file at the terminal, the following type of message occurs: mm-Pro:~ mm$ emacs experiment.hs 2019-02-21 15:56:19.243 Emacs[2937:261832] Failed to initialize color list un...
Avent asked 21/2, 2019 at 16:28

4

Solved

NSKeyedUnarchiver.decodeObject will cause a crash / SIGABRT if the original class is unknown. The only solution I have seen to catching this issue dates from Swift's early history and required usin...
Marxismleninism asked 2/10, 2015 at 9:57

3

Im trying to pass an array of 'Employee' objects iPhone to Apple Watch by serializing the array : NSData *encodedObject = [NSKeyedArchiver archivedDataWithRootObject:employees]; and unserializin...

5

Solved

I have an iOS 7 application that saves a custom object to app's iCloud Docs folder as a file. For this, I make use of NSCoding protocol. @interface Person : NSObject <NSCoding> @property (...
Ester asked 25/8, 2014 at 18:27

1

Solved

My app uses a custom class as its data model: class Drug: NSObject, NSCoding { // Properties, methods etc... } I have just created a Today extension and need to access the user’s data from it, ...
Primateship asked 2/2, 2018 at 13:30

3

I am using NSKeyedUnarchiver to unarchive an object and would like to use the delegates (NSKeyedUnarchiverDelegate), but my delegates are not called. Archiving and Unarchiving is working fine, but ...
Yale asked 16/1, 2016 at 7:30

1

Solved

I'm using NSKeyedArchiver & NSKeyedUnarchiver to store some complex data in Core-Data and retrieve it later in my app. This was working perfectly until now, but after migration, Swift 3.0 does ...
Huddle asked 19/12, 2016 at 14:39

1

Solved

I have the following code that I use to unarchive a file in my Mac application: func tryOpen(_ filePath: String) throws -> NSArray { if #available(OSX 10.11, *) { do { if let data = try? Dat...
Jurywoman asked 15/9, 2016 at 21:30

3

Solved

I have this simple class import UIKit class SimpleModel: NSObject, NSCoding { var name : String! var done : Bool! init(name:String) { self.name = name self.done = false } internal requi...
Pellucid asked 20/8, 2016 at 12:17

1

In Swift, NSKeyedUnarchiver.unarchiveObjectWithData(data) will throw an exception if data can't be unarchived. There are some situations where we have no guarantee if that the data is not corrupte...
Roberge asked 15/10, 2014 at 3:42

2

Solved

As I understand, the use of @try/@catch blocks is discouraged, because exceptions should only be thrown at unrecoverable, catastrophic errors (refer to this discussion with a nice answer by @bbum: ...
Therapeutics asked 25/6, 2013 at 14:1

1

Solved

I have a pretty trivial Swift app that has a model class named DemoNote. An array of DemoNote instances is read/written via keyed archiving. This worked fine while DemoNote was included in the app....
Sulfanilamide asked 17/2, 2015 at 19:22

1

Solved

I have the following code, used to get the path of an object that has been archived let paths = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask....
Pyrenees asked 2/7, 2014 at 18:46

1

Solved

I'm trying a basic implementation of the NSCoding protocol in swift, but it seems I can't success to unarchive an object after it has been correctly archived. Here's my attempt import Cocoa clas...
Manzano asked 5/7, 2014 at 19:37

0

I have the following problem while unarchiving a file, which contains an xml string. It crashes at the following line: NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWit...
Depute asked 21/11, 2013 at 10:1
1

© 2022 - 2025 — McMap. All rights reserved.