Questions tagged [transformable]

Use this tag only for questions directly related to core data Transformable attribute type.

Transformable attributes are useful for storing nonstandard object types(Array, CoreData, Dictionary) within Core Data.

41 questions
34
votes
1 answer

How do I get mogenerator to recognize the proper type for Transformable attributes?

I have a Core Data model with a single transformable attribute. I also have this attribute use a custom NSValueTransformer, setup in the model properly. When I use mogenerator to generate/update my machine and human files, the machine files for the…
casademora
  • 67,775
  • 17
  • 69
  • 78
10
votes
3 answers

Core Data Transformable attributes NOT working with NSPredicate

I often use Transformable for Core Data attributes, so I can change them later. However, it seems like, if I want to use NSPredicate to find a NSManagedObject, using "uniqueKey == %@", or "uniqueKey MATCHES[cd] %@", it's not working as it should. It…
petershine
  • 3,190
  • 1
  • 25
  • 49
10
votes
2 answers

Core Data error switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead

I am getting this CoreData error. I have no idea why I'm getting this error. I'm not using any Transformable types. I see nothing in my code indicating that I'm using transformable properties. I let Xcode set up CoreData by selecting the Use Core…
daniel
  • 1,446
  • 3
  • 29
  • 65
7
votes
3 answers

Error: -[UIImage _deleteExternalReferenceFromPermanentLocation] unrecognized selector sent to instance

When I delete a managed object that contains image, stored as transformable value in external record, then I got crash and this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImage…
Shmidt
  • 16,436
  • 18
  • 88
  • 136
7
votes
2 answers

CoreData - Store an array of Tranformable objects

I have an entity that has a traformable property. It is an array of custom object, Reminder that confirms to NSSecureCoding. @objc(Reminder) public class Reminder: NSObject, NSSecureCoding { public static var supportsSecureCoding: Bool = true …
mahan
  • 12,366
  • 5
  • 48
  • 83
5
votes
3 answers

Swift And CoreData With Custom Class As Transformable Object

I am trying to use a custom class with swift and CoreData as a transformable object. I have been wasting hours trying to figure it out but cannot. I keep getting two errors: Property cannot be marked @NSManaged because its type cannot be represented…
King Tech
  • 314
  • 1
  • 3
  • 12
4
votes
1 answer

How to fix the ''NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release' error?

I am using Core Data for persistent storage and I am getting the error listed below. I have looked up the message and I know it has something to do with the fact that I am using the transformable and a custom class. Despite my research I am not sure…
Part_Time_Nerd
  • 994
  • 7
  • 26
  • 56
4
votes
1 answer

UITableView "cellForRowAt: indexPath" Occasionally Calling "init?(coder aDecoder: NSCoder)" on Core Data Attribute

I have a core data entity Person with a transformable attribute age of type Age. final class Person: NSManagedObject { @NSManaged public fileprivate(set) var age: Age } Age adopts the NSCoding protocol and has two variables value and scale, but…
ajrlewis
  • 2,968
  • 3
  • 33
  • 67
4
votes
0 answers

Need help debugging exception in _encodeObject when using [NSValue valueWithCATransform3D: ] to create Transformable attribute

I am trying to save a CATransform3D in a Core Data store. In my custom NSObject subclass I use: self.transform = [NSValue valueWithCATransform3D: inputTransform ]; to convert the input CATransform3D to an NSValue. NSLog shows what looks like the…
3
votes
1 answer

Core Data: How do I store a custom object as a transformable attribute?

Currently I have a class called Place defined as follows: class Place { let name: String let address: String let coordinate: CLLocationCoordinate2D let type: String var photoReference: String? var photo: UIImage? /*…
Walee
  • 59
  • 3
2
votes
1 answer

Storing Custom Class type array in Coredata

I am trying to store custom class type array in coredata. What I've got setup is an Entity called Node with properties value of type string and children of type Transformable. The children property is supposed to store an array of type Node as in…
unknown
  • 788
  • 9
  • 24
2
votes
1 answer

how to store [[string]] and get it from core data?

I have sample array of [[string]] like this [["A", "B", "C"], ["A"], ["B", "C"], ["C"], ["B"], ["B", "C", "A"]] I store it to core data like this : insertHeroes.setValue(roless, forKey: "roles") which roless is array result from API (after append…
Sarimin
  • 707
  • 1
  • 7
  • 18
2
votes
1 answer

Swift: how to store array of custom objects in Core Data?

Using Swift and Core Data, I want to store an array of custom Game objects in my custom User class in the database. The GameOwned variable is a Transformable. I want to be able to store [Game] inside the database. How can I go about achieving this?…
The Nomad
  • 7,155
  • 14
  • 65
  • 100
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

Transformable and NSKeyedUnarchiveFromData

I'm trying to save a Measurement to a Core Data transformable property. Basically, what's in this answer, only a different unit: How to Save a Generic Measurement in Core Data? Everything works, however I'm getting this message in the…
StonedStudio
  • 507
  • 3
  • 20
1
2 3