Questions tagged [nskeyedunarchiver]

NSKeyedUnarchiver, a concrete subclass of NSCoder, defines methods for decoding a set of named objects (and scalar values) from a keyed archive. Such archives are produced by instances of the NSKeyedArchiver class.

NSKeyedUnarchiver, a concrete subclass of NSCoder, defines methods for decoding a set of named objects (and scalar values) from a keyed archive. Such archives are produced by instances of the NSKeyedArchiver class.

A keyed archive is encoded as a hierarchy of objects. Each object in the hierarchy serves as a namespace into which other objects are encoded. The objects available for decoding are restricted to those that were encoded within the immediate scope of a particular object. Objects encoded elsewhere in the hierarchy, whether higher than, lower than, or parallel to this particular object, are not accessible. In this way, the keys used by a particular object to encode its instance variables need to be unique only within the scope of that object.

Click Here for class reference.

203 questions
0
votes
2 answers

NSKeyedUnarchiver returns nil after subsequent app launch

EDIT: Have checked and rechecked file paths, code for archiving and unarchiving and no bugs found. Is there an issue with App File System between launches that I am not aware of? I am using NSCoder to store images in my app. I create a unique file…
noobsmcgoobs
  • 2,716
  • 5
  • 32
  • 52
0
votes
0 answers

NSKeyedArchiver crashing app with exception error

I am trying to save an image to my Documents folder using NSCoding and NSKeyedArchiver. The app works like this: A user takes a picture, sees a preview, saves the image then can see the image in a gallery section. I do not save multiple images at…
noobsmcgoobs
  • 2,716
  • 5
  • 32
  • 52
0
votes
0 answers

Long delays displaying UIImageView loaded from local file?

I see questions regarding long delays in displaying UIImageViews after downloading, but my question involves long delays when reading from local storage. After archiving my hierarchy of UIImageViews to a local file (as per narohi's answer in How to…
sh37211
  • 1,411
  • 1
  • 17
  • 39
0
votes
1 answer

Renamed Core Data Transformable

I'm using CoreData to manage my offline storage in my app. The data of the offline storage is saved in an custom NSObject as a transformable in the xcdatamodel. My current version in the app (v1.0) is storing the Navigation class. I needed to rename…
0
votes
2 answers

Save custom class objects in NSUserDefaults in Swift

Im trying to save some objects in an array but my objects are used inherited properties But when trying to read the object it says Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -decodeObjectForKey: cannot be…
slozano95
  • 278
  • 7
  • 22
0
votes
1 answer

iOS NSKeyedUnarchiver not get correct value

I simplify the code for ask question. I want to save more class and load class model file. But now I simplify parameters to one part (lim) in the model(FlightSettingModel.h). In the FlightSettingModel.h I have set some parameters in…
dickfala
  • 3,246
  • 3
  • 31
  • 52
0
votes
1 answer

NSUserDefaults and archiver retrieval issue

I encountered a strange problem with NSArray. The app requires to hit the same web service at two scenarios with different input. One is at initial state, where the response from server is saved to NSUserDefaults with the help of NSKeyedArchiver.…
Nina
  • 1,579
  • 2
  • 21
  • 51
0
votes
1 answer

How can I store array that contains PFObjects in NSUserDefaults?

Some PFObject contains PFFile(Image file) and some are not.When I am trying to store custom object in to user default using NSKeyedArchiver and NSKeyedUnarchiver, it won't work. Help me how to store PFObjects array into UserDefault which contains…
0
votes
1 answer

NSKeyedUnarchiver unarchiveObjectWithData: in Parse block function never returns

I am requesting a file representation of an NSDictionary from Parse.com (yes I know there are other more obvious ways to store dictionaries) and then in the completion block the data gets unarchived and assigned to a property. When this code…
Dancreek
  • 9,524
  • 1
  • 31
  • 34
0
votes
1 answer

Reading wrong class type with NSKeyedUnarchiver

In my app, I'm reading and writing an NSMutableArray to NSUserDefaults. This array contains objects that look like this: header file: #import #import @interface WorkLocationModel :…
Erik
  • 2,500
  • 6
  • 28
  • 49
0
votes
1 answer

How to persist a file under NSHomeDirectory()?

I am using NSKeyedArchiver and NSKeyedUnarchiver to implement cache function for my app. In order to load the cache file each time the app launches, I store the cache file under NSHomeDirectory(). The code (C function) is as following: NSString*…
PinkiePie-Z
  • 525
  • 1
  • 6
  • 28
0
votes
1 answer

Core Data message Unable to find an instance of NSValueTransformer registered for the name: NSKeyedUnarchiveFromDataTransformerName

I am using Core Data to store NSAttributedString and use a transformable field to store the data. However I get the message below from Core Data, although everything seems to work fine. How can I get rid of the message or can I safely ignore…
Duncan Groenewald
  • 8,496
  • 6
  • 41
  • 76
0
votes
1 answer

How can I save CLLocation better?

I am trying to save my CLLocation location for future use in my app. I have come up with the following: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths…
0
votes
1 answer

How to unarchive unknown objects?

I created two Apps for iPad based on 2 object classes (classA and classB). I serialized classA in a file with NSKeyedArchiver (then attached to an email). I want to unarchive the classA object in the other app that uses classB, without including all…
user1595462
  • 155
  • 1
  • 9
0
votes
2 answers

NSKeyedArchiver not persisting data

So, my app queries an Amazon Dynamo DB database and retrieves a few kilobytes worth of data. What I want the app to do is download everything the first time, and then every time after, just download a timestamp to see if it has the most recent…
effendo
  • 93
  • 1
  • 8