Questions tagged [nssecurecoding]

Conforming to the NSSecureCoding protocol indicates that an object handles encoding and decoding instances of itself in a manner that is robust against object substitution attacks.

Conforming to the NSSecureCoding protocol indicates that an object handles encoding and decoding instances of itself in a manner that is robust against object substitution attacks.

Click Here for class reference.

48 questions
3
votes
5 answers

How do I use NSSecureCoding to guarantee the content of collection classes?

I have an object of class SGBContainer which has an array named objects that contains objects of class SGBObject. Currently, they each implement NSCoding but not NSSecureCoding. The -initWithCoder: for SGBContainer looks like this: -…
Simon
  • 25,468
  • 44
  • 152
  • 266
2
votes
0 answers

SecureCoding with Subclasses and CoreData ni swift

I wanted to implement diferrent possible values within a CoreData field as Transformable and subclasses. Swift doesn't seem to like my implementation: (the superclass) public class ResponseItemValueDTODB: NSObject, NSSecureCoding { public static…
LetynSOFT
  • 134
  • 1
  • 8
2
votes
1 answer

NSKeyedUnarchiver.unarchiveTopLevelObjectWithData return nil

I want to save an array of objects into UserDefaults and load it back. When trying to unarchive the data it always returns nil.. any idea? This is my object: class DbInsideLevel: NSObject, NSSecureCoding { static var supportsSecureCoding:…
ytpm
  • 4,962
  • 6
  • 56
  • 113
2
votes
0 answers

NSKeyedUnarchiver unarchivedObjectOfClass implementation gives error

I am updating an old Objective C app that uses 'NSKeyedUnarchiver unarchiveObjectWithData' which is now deprecated. The app archives an array consisting of custom objects that contain (among other things) another array of a different custom object.…
Bob
  • 559
  • 1
  • 5
  • 18
2
votes
2 answers

RealityKit Custom ARAnchor not syncing across devices

I'm using Apple's custom ARAnchor in a config.isCollaborationEnabled = true environment. When I call the following on DeviceA: let boardAnchor = BoardAnchor(transform: last.worldTransform, size: CGSize(width: 10, height:…
Chris
  • 2,739
  • 4
  • 29
  • 57
2
votes
1 answer

Trying to use GKComponent subclass in SpriteKit editor silently crashes Xcode on save

I am trying to work with GameplayKit and SpriteKit using the scene editor in Xcode. I am new to SpriteKit and also have not used NSSecureEncoding before. Pretty new at swift to be honest. I have a basic GKComponent subclass with one integer one…
Mike Beaumont
  • 91
  • 1
  • 3
1
vote
2 answers

When I run my code I get a weird output (listed in question). What do I do?

from turtle import Turtle, Screen timmy_the_turtle = Turtle() timmy_the_turtle.shape("turtle") screen = Screen() screen.exitonclick() print("Hi") When I run this I get this output: 2023-06-18 13:08:23.720 Python[71369:2018591] WARNING: Secure…
Aiden
  • 27
  • 1
1
vote
1 answer

Swift NSSecureCoding unexpectedly found nil while unwrapping

I am storing a transformable in CoreData and am trying to make it NSSecureCoding compliant, but I keep getting Unexpectedly found nil whilst unwrapping an optional value, when I try to decode in the XCDataModel, I am set the property as…
1
vote
1 answer

NSSecureCoding: Writing UIView to disk

Is it possible to write a UIView to disk using NSSecureCoding. The below code results in an error. NSData *data = [NSKeyedArchiver archivedDataWithRootObject:object requiringSecureCoding:YES error:&error]; Error: The data couldn’t be written…
user1752054
  • 372
  • 4
  • 17
1
vote
1 answer

Why is NSArray of NSNumber(s) failing to decode?

I have a custom class that conforms to NSSecureCoding. I'm trying to encode its data, write it to a file, and decode it. The class contains an int array which I convert to an NSArray filled with NSNumber elements before encoding. When I decode the…
1
vote
0 answers

NSTextAttachment Subclass doesn't support Secure Coding as it overrides -initWithCoder: and does not override +supportsSecureCoding

I am trying to save an NSAttributedString with textAttachments to core data. To do this I need to transform it with this as core data no longer accepts NSKeyedUnarchiver: @objc(NSAttributedStringTransformer) class NSAttributedStringTransformer:…
santi.gs
  • 514
  • 3
  • 15
1
vote
1 answer

NSSecureCoding crash in Core Data

I am getting crash reports from users when fetching from my Core Data entity with a fetch request. This is what the crash looks like: SIGABRT: Unhandled error (NSCocoaErrorDomain, 4864) occurred during faulting and was thrown: Error…
Z S
  • 7,039
  • 12
  • 53
  • 105
1
vote
1 answer

Swift - How to encode a Bool type with NSSecureCoding

I am having trouble saving a Bool variable using the NSSecureCoding within a Swift app. I don't have any experience with Objective-C and I'm relatively new to Swift (I have a c# background). As I understand, using NSSecureCoding requires us to use…
user2430797
  • 320
  • 5
  • 18
1
vote
0 answers

NSSecureCoding protocol cause application to crash

I am using Coredata with Transformable types and getting a lot of this warning: 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release So I tried to make adjustments, this was my custom class…
ytpm
  • 4,962
  • 6
  • 56
  • 113
1
vote
0 answers

Class 'ARCollaborationData' disallows secure coding

I have an app that offers collaboration in AR and I was following the docs on how to send ARSession.CollaborationData using…
TurboFish
  • 7,789
  • 4
  • 18
  • 27