Find Jobs
Hire Freelancers

Archiving and Unarchiving Use Case

€8-30 EUR

Completed
Posted about 8 years ago

€8-30 EUR

Paid on delivery
Develop 2 simple apps or one app with 2 targets for a simple usecase. Lets name them APP_TARGET1 & APP_TARGET2. APP_TARGET1 saves an object stream using NSKeyedArchiver. let data = NSMutableData() var keyedarchiver:NSKeyedArchiver=NSKeyedArchiver(forWritingWithMutableData: data); [login to view URL](<myobject>, forKey: "rootobject"); // <myobject> can be simply a String like "content" [login to view URL](); let bytes = [login to view URL]; let len=[login to view URL]; [login to view URL](<yourpath>,...); APP_TARGET2. reads the object stream using NSKeyedUnarchiver. let data: NSData? = NSData(contentsOfFile: <yourpath>) var mykeyedunarchiver:NSKeyedUnarchiver=NSKeyedUnarchiver(forReadingWithData: data!); [login to view URL] = self; let temp:AnyObject?=[login to view URL]("rootobject") if temp==nil { blobsexists=false; }else{ let object = temp! as! <myobject_class>'; // Can be a String print(object); // Can be print(String); } The Problem I was facing with it is, that when reading the object stream in APP_TARGET2, I got an error as follow: "cannot decode object of class ([login to view URL])" I guess the problem can be solved by using the following delegate method of the protocol NSKeyedUnarchiverDelegate: func unarchiver(unarchiver: NSKeyedUnarchiver, cannotDecodeObjectOfClassName name: String, originalClasses classNames: [String]) -> AnyClass? { print("I am in unarchiver, because the classname is wrong : " + name); return ?????; } But I did not succeed, thats why I need a working sample for this usecase. interested for this challenge ? Testplan: 1. Step is trying to reproduce the error when reading back the stream. This is a must, otherwise I am not sure, if step 2 solves the issue. 2. Step solving the issue. Reading the Object
Project ID: 9376035

About the project

6 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
hello i like bids on your project = ) i understand your problem and there're a couple of ways to do it. in fact i don't really like swift, but can help you anyway 6 years of experience in iOS applications development clear and compact code best regards Dmitriy
€29 EUR in 1 day
5.0 (7 reviews)
3.6
3.6

About the client

Flag of SWITZERLAND
würenlos, Switzerland
5.0
38
Payment method verified
Member since Oct 27, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.