I'm using a NSKeyedArchiver to encode a big object graph (76295 objects.)
It takes a lot of time but even worse the NSKeyedArchiver doesn't give back all its memory.
After using the Leak check, the code doesn't appear to leak at all but for some reason the encoding doesn't give back all memory after it's done.
Calling the encode method...
I need to archive a NSMutableArray which is being controlled by an ArrayController. I tried this:
[NSKeyedArchiver archivedDataWithRootObject:array];
But I got this error:
*** -[NSKeyedArchiver dealloc]: warning: NSKeyedArchiver deallocated
without having had -finishEncoding
called on it.
How may I solve that please?
...
I found a leak in my code where archiving and unarchiving an NSURLResponse was causing a leak, and I can't figure out why.
- (void)doStuffWithResponse:(NSURLResponse *)response {
NSMutableData *saveData = [[NSMutableData alloc] init];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:s...
Hello,
I am a newbie in the iPhone dev and I want to know if I will save some data(NSSDictinary) with NSKeyedArchiver, tis data persist after an update process of my app via AppStore?
Let's say that I want to save user an pass for my app and probably this information will be saved into the app folder.If I will update the app via AppStor...
When I use NSKeyedArchiver is the data that is written a *.plist, I have seen some examples where people have the output file down as *.txt or even without an extension at all?
-(void)saveCore {
NSMutableData *data = [[NSMutableData alloc] init];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:...
I have made an class which conforms to the NSCoding protocol and does all the encode and decode stuff.
For my app, I simply want to persist an object from that class to the device and the next time when the app launches, I want to load that object back into memory.
Basically it's just an class which holds some user input information. F...
i saw this approach on a tutorial, and the message is working for their example but when i implement this it does not work. from what i can tell the iphone simulator crashes when i do a [ self saveSettingsData]. TheSettings is class object that i declare and initialize in the appdelagate with these methods. the error says terminating due...
Example: If I used this, where does the iPhone store the file?
if (![NSKeyedArchiver archiveRootObject:your_object toFile:@"filename.plist"])
// save failed.
On my mac the filename.plist goes to Macintosh HD directly. No folder. Also, the NSKeyedArchiver doesn't seem to ask for a path, just for a file name. Strange or not?
And how...
Hey guys,
I have converted CGPoint To NSValue and put all the resulting values in q NSArray but when i use [NSKeyedArchiver archiveRootObject:ArrayName toFile:PointArrayFile]; it gives me error.
If some one know please do help me how can I achieve this ...
Thanks
Umer Sufyan
...
Hey
does anyone have any examples of using NSKeyedArchiver in monotouch? i just want to store a list of pocos
w://
...
In my app, a user can select an image, change the picture of a UIImageView to the new imge, and save the image to NSUserDefaults using NSKeyedArchiver. When the user selects the image and the - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info is called, the app immediately ...
I'm doing some archiving to a property list and when I unarchive my data using NSKeyedUnarchiver I find that my app crashes if I release the object afterward. I was wondering if the finishDecoding message also autoreleases the object. Seems weird that it crashes when I release it.
...
Hi, I'm trying to write a basic test "game state" singleton in cocos2d, but for some reason upon loading the app, initWithCoder is never called. Any help would be much appreciated, thanks.
Here's my singleton GameState.h:
#import "cocos2d.h"
@interface GameState : NSObject <NSCoding>
{
NSInteger level, score;
Boolean seenInstruct...
I have a Location class that contains a lat/lon as well as an elevation and timestamp:
@interface Location : NSObject <NSCoding> {
double lon;
double lat;
double ele;
NSDate *time;
NSDateFormatter *gpxDateFormatter;
}
I want to be able to serialize an NSMutableArray containing an arbitrary number of these Location objects into ...
How do I archive an array of NSValues ? What conversions should I make to do this? It won't archive it as is.
Code:
[[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver
archivedDataWithRootObject:[[NSArray alloc] initWithArray:drawingsArray]]
forKey:@"NSValuesArray"];
Error:
*** Terminating app due to uncaught exce...
Hi,
I'm using NSKeyedArchiver to persist multiple objects in my application. The persistence is working fine, but I can't find a way to delete a specific object from the file. How do I delete this object programmatically?
Thanks,
Teja
...
We've got a custom matrix class, and we're attempting to archive and unarchive an NSArray containing four of them. The first seems to get unarchived fine (we can see that initWithCoder is called once), but then the program simply hangs, using 100% CPU. It doesn't continue or output any errors. These are the relevant methods from the matr...
I'm using NSKeyedArchiver in Mac OS X program which generates data for iPhone application. I found out that by default, resulting archives are much bigger than I expected. Example:
NSMutableArray * ar = [NSMutableArray arrayWithCapacity:10];
for (int i = 0; i < 100000; i++) {
NSString * s = [NSString stringWithFormat:@"item%06d", i...
Hi
I was trying to archive an object into a plist file and load it later to fill a tableView.
It seems that the file gets archived correctly but I get a bad access when trying to get the value out of the file.
Am I doing something wrong?
This is where I save it
// Create some phonebook entries and store in array
NSMutableArray *book ...
I'm developing a game/engine for iPhone OS. It's the first time I'm using Objective-C.
I made my own binary format for geometry data and for textures I'm focusing on PVRTC. That should be the optimal approach as far as speed and space are concerned. I really want to keep loading time to a minimum and - if possible - be able to save very...