Questions tagged [nsvaluetransformer]

NSValueTransformer is an abstract class that is used by the Cocoa Bindings technology to transform values from one representation to another. An application creates a subclass of NSValueTransformer, overriding the necessary methods to provide the required custom transformation.

60 questions
60
votes
1 answer

What can I do with an Transformable attribute type in Core Data on the iPhone?

There's this Transformable data type for attributes. What is it good for? Are there good examples? I'd like to play around with this. So after searching a while I came across this: NSValueTransformer. Seems to be something I need for this. So how…
dontWatchMyProfile
  • 45,440
  • 50
  • 177
  • 260
17
votes
2 answers

Custom NSValueTransformer in xcode 6 with swift

Did anyone successfully implement a custom NSValueTransformer in xcode 6 beta with swift? I have the following swift class: import Foundation class myTransformer: NSValueTransformer { let amount = 100 override class func…
marschro
  • 791
  • 8
  • 23
13
votes
2 answers

Use Swift's Date with CoreData

I have a lot of date fields in my database model. CoreData allows to use NSDate or TimeInterval to save dates depending on "Use Scalar Type" option. However both these options are bad for me since I want to use dates as Date objects. Since NSDate…
Avt
  • 16,927
  • 4
  • 52
  • 72
8
votes
1 answer

NSImage has opacity when used with NSValueTransformer

I am trying to show an NSImage depending on a enum value from out of Core Data. I am using a Value Transformer on an NSImageCell bound to the value on which I choose the image to show. It works perfectly and as intented, unfortunetaly when using the…
phikes
  • 565
  • 5
  • 13
7
votes
2 answers

Core Data - How to check if an object relationship exists without firing a fault

There is an object A and an Object B. Object B has one attribute that is type transformable (image), and one relationship, which is to an object A. Object A may have a relationship to one, and only one, object B, or it may not. As I enumerate…
SAHM
  • 4,078
  • 7
  • 41
  • 77
7
votes
2 answers

Core Data Encryption

I have a question about Core Data encryption. I'm storing some sensitive user data in a Core Data SQLite database. The critical values are all transformables and I'm using AES256 to encrypt and decrypt them 'on the fly', including an individual IV…
el3ktro
  • 167
  • 2
  • 9
5
votes
1 answer

Cocoa: How to bind a boolean property to NSCellStateValue?

I would like to bind the boolean enabled property of an NSTextField to the state of an NSButton. I already tried adding a custom NSValueTransformer that transforms the state of the NSButton into NSNumber. However, in that scenario the text fields…
JJD
  • 50,076
  • 60
  • 203
  • 339
5
votes
4 answers

what's the correct way to store an NSURL in Core Data?

I'm trying to archive / unarchive NSManagedObjectIDs in Core Data objects so that next time my app starts up I can retrieve these IDs and use them to fetch specific objects. I tried "archiving" the ID like this: //defaultConfiguration is an…
SaldaVonSchwartz
  • 3,769
  • 2
  • 41
  • 78
4
votes
1 answer

Mantle - Transform a Nested Model in Swift

I am having a lot of trouble de-serializing and serializing a nested model in Swift using Mantle. I believe I have everything set up correctly, but I can't even get past the compilation errors. To give some perspective, I have successfully…
Alexander
  • 3,959
  • 2
  • 31
  • 58
4
votes
1 answer

Trouble when returning non pointer object in a block

I'm using Mantle to help me transform model objects to JSON. One of my objects contains a centroid property defined as follows: @property (assign) CLLocationCoordinate2D centroid; When I deal with the server I receive the property in this…
4
votes
1 answer

Saving custom class into Coredata

Hi i have used attribute type transformable and i have followed the procedure of archiving in one of the Forum . But it says CoreData: warning: no NSValueTransformer with class name 'SurveyResults' was found for attribute 'survey' on entity…
Dheeraj Kaveti
  • 171
  • 1
  • 2
  • 10
4
votes
1 answer

NSPopupButton Bindings with Value Transformer

I don't know if what I see with a popup button populated by bindings with a value transformer is the way it's supposed to be or not -- the unusual thing I'm seeing (at least with respect to what I've seen with value transformers and table views) is…
rdelmar
  • 103,982
  • 12
  • 207
  • 218
3
votes
1 answer

Changing NSValueTransformer to NSSecureUnarchiveFromDataTransformer for Core Data warning

In my Core Data schema, I have a 'transformable' attribute in an entity, which is using a NSValueTransformer, the purpose of which is to convert a UIImage into NSData with some compression. From this attribute, I had recently started getting these…
Z S
  • 7,039
  • 12
  • 53
  • 105
3
votes
1 answer

Using an NSValueTransformer to set values of an NSManagedObject instance

I am using a custom NSValueTransformer to store color information in my Core Data store. The transformation between Transformable data and a UIColor instance works great once the color data is in the store already (ie once the app has been run and…
rob5408
  • 2,972
  • 2
  • 40
  • 53
3
votes
2 answers

iOS Core Data encryption using NSValueTransformer

I'm experimenting with encrypting data with Core Data and CommonCrypto. I am trying to use a NSValueTransformer to lazily encrypt and decrypt. However when I'm now trying save the encrypted data to the persistent store coordinator, it fails. Every…
Orion
  • 1,258
  • 2
  • 14
  • 32
1
2 3 4