Error using keyed archiving on iPhone

Hi
I am trying to archive an object using keyed archiving. I have managed to successfully create the archive, but attempts to load it results in the following error:
'NSInvalidArgumentException', reason: '* -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0xffffffce, 0xfffffffa, 0xffffffed, 0xfffffffe, 0x7, 0x0, 0x0, 0x0)'
The code:
path = [[NSBundle mainBundle] bundlePath];
finalPath = [path stringByAppendingPathComponent:@"DataStore"];
- (void)saveArchive {
NSMutableData *data;
NSKeyedArchiver *archiver;
BOOL result;
data = [NSMutableData data];
archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[archiver encodeObject:myDataStore forKey:@"DataStore"];
[archiver finishEncoding];
result = [data writeToFile:finalPath atomically:YES];
[archiver release];
- (void)loadArchive {
NSData *data;
NSKeyedUnarchiver *unarchiver;
data = [NSData dataWithContentsOfFile:finalPath];
unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
myDataStore = [unarchiver decodeObjectForKey:@"DataStore"];
[unarchiver finishDecoding];
[unarchiver release];
Any help would be appreciated please

Solved. Can only write to documents or temp directory on iPhone

Similar Messages

  • I tried to install the new iOs 7 on my iphone 4, but it wasn't completed (showing error 4005). Now, my iphone is stuck on the itunes' logo with the usb cord, and I can't use my phone. And itunes doesn't detect my iphone when I connect it on my computer.

    Hi everyone! I tried to install the new iOs 7 on my iphone 4, but it wasn't completed (showing error 4005). Now, my iphone is stuck on the itunes' logo with the usb cord, and I can't use my phone. And itunes doesn't detect my iphone when I connect it on my computer, so I can't put it in recovery mode or someting like that... What can I do?? I tried everything they tell me to do in the apple support but nothing seems to work. Thank you!

    No problem, glad to help!
    Update: my PC USB hub was connected to a USB 3 port, I connected the 30 pin cable directly to my PC, And the restore worked just fine. Restored phone from iCloud backup and seems to be working fine.

  • Is There a way of using an alt key on the iphone (to so alt characters)

    Is There a way of using an alt key on the iphone (to so alt characters)??
    Cheers all.

    There is no alt key, so no, but there are a lot of preloaded symbols already on the phone, all you have to do is hold a key and extra options will come up. For example, if you want an accent over a, hold a, and it will give you options for it. This also works with the symbols, for example, the $ symbol can be held to provide the money symbol for euros, yens, pounds, etc.

  • I used to update my iPhone 4S applications whenever a new update is available, but at this time, "unknown error" displays after entering my apple id password. Anyone who could help, whom they might have experienced? Thanks

    I used to update my iPhone 4S applications whenever a new update is available, but at this time, "unknown error" displays after entering my apple id password. Anyone who could help, whom they might have experienced? Thanks

    Hi Christianjr,
    When you say you reset your network settings, what do you mean, exactly?
    I saw another post on this issue, and the poster indicated that they resolved the problem by turning off their cellular date option and wifi options in Settings, and then turned them back on.
    Also, resetting your phone may help - press the Home and Power buttons at the same time and continue to hold both down until the Silver Apple appears. Once it is back up, click on the update option and see if it fixes the problem.
    If none of those things work, then need to have details on what you did to reset your network settings....
    Cheers,
    GB

  • HT1386 I've updated my 2007 MacBook to 10.6.8, and now my iPhone 3 (used as iPod) and iPhone 4 aren't recognized to be synced anymore or I get an error message telling me to update my phone to 11.1 or something. When I do that is appears to update and whe

    I've updated my 2007 MacBook to 10.6.8, and now my iPhone 3 (used as iPod) and iPhone 4 aren't recognized to be synced anymore or I get an error message telling me to update my phone to 11.1 or something. When I do that is appears to update and when finished nothing appears to have updated.

    It is possible one of the 10.6.8 updates may help:
    Combo v1.1 (7/25/2011), 10.6.8 2013 Security Update 004, 2013-005 Java update.
    Note, your machine is too old to use the latest Java from http://www.java.com/

  • Am not able to use facebook on my Iphone 4, softwareversion:iOS7.1, also tried to access through safari and chrome that i have installed it gives an error message saying: "safari could not open the page because server stopped responding",

    Am not able to use facebook on my Iphone 4, softwareversion:iOS7.1, also tried to access through safari and chrome that i have installed it gives an error message saying: "safari could not open the page because server stopped responding", i tried network reset, reset the whole device, rebooting , changing airplane mode rebooting nothing fix the issue, but i can access other sites and google , am using Vodafone as my carrier with 2g network, when at home able to access facebook.com through wifi in safari requesting assistance thank you

    If you can access Facebook while on Wifi at home, but you are unable to access it while away running on your carrier's 2G network, I could phone your carrier.  You have already completed the Cellular Data troubleshooting for the iPhone, so any limitations keeping your from connecting to Facebook over cellular will have to be answered by your carrier.

  • When I try to sync my iPhone, I get an error message that says "This iPhone cannot be used because the Apple Mobile Device Service is not started.  There's no explanation of what to do to fix it.

    When I try to sync my iPhone, I get an error message that says "This iPhone cannot be used because the Apple Mobile Device Service is not started.  There's no explanation of what to do to fix it.

    Follow  this article:
    How to restart the Apple Mobile Device Service (AMDS) on Windows

  • When I try to install Adobe Acrobat XI Pro, I get an error message, "Key not valid for use in specified state".  What is this?

    When I try to install Adobe Acrobat XI Pro, I get an error message, "Key not valid for use in specified state".  What is this?

    See if this post by turingtest2 fixes it : key not valid for use in specified state

  • Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state

    we have developed packages to do the followings
    Extract data from DB2 Source and put it in MS Sql Server 2008 database (Lets Say DatabaseA).From MS Sql Server 2008 (DatabaseA)
    we will process the data and place it in another database MS Sql Server 2008 (DatabaseB)
    We have created packages in BIDS..We created datasource connection in Datasource folder in BIDS..Which has DB2 Connection and both Ms Sql Server connection (Windows authentication-Let
    say its pointing to the server -ServerA which has DatabaseA and DatabaseB).The datasource connections will be used in packages during development.
    For deployment we have created Package Configuration which will have both DB2 Connection and MS SqlServer connection in the config
    We deployed the packages in different MS SqlServer by changing the connectionstring in the config for DB2 and MS SqlServer...
    While runing the package we are getting the following error message
    Code: 0xC0016016     Source:       Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for
    use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
    ilikemicrosoft

    Hi Surendiran,
    This is because the package has been created by somebody else and the package is being deployed under sombody else's account. e.g. If you are the creator then the package is encryption set according to your account and the package setup in SQL server is
    under a different user account.
    This happens because the package protection level is set to EncryptSensitiveWithUserKey which encrypts
    sensitive information using creator's account name.
    As a solution:
    Either you have to set up the package in SQL server under your account (which some infrastructures do not allow).
    OR
    Set the package property Protection Level to "DontSaveSensitive" and add a configuration file
    to the package and set the initial values for all the variables and all the connection manager in that configuration file (which might be tedious of-course).
    OR
    The third options (which I like do) is to open the package file and delete the password encryption entries from the package. Do note that this is not supported by designer and every time you make changes to the connection managers these encryption entries come
    back.
    Hope this helps. 
    Please mark the post as answered if it answers your question

  • I updated my iPhone to ios5. Receive error message " could no activate iPhone" iTunes message says there is no SIMM in phone. The SIMM I have used all along has not been removed.

    Subject:
    I updated my iPhone to ios5. Receive error message " could no activate iPhone" iTunes message says there is no SIMM in phone. The SIMM I have used all along has not been removed.

    I know I answered you before on this but can't find the thread. Guess you didn't like my answer. Your phone was illegally hacked to unlock it and when you updated the phone it relocked it back to the original carrier. This made the sim you had in the phone useless and therefore it cannot activate the phone. Nothing can be done in these forums to help you fix your problem as it is against the TOS to discuss illegal unlocking or jailbreaking the phone.

  • Can't download iTunes, error message "Key not valild for use in specified state"

    I can't download iTunes, keep getting error message "Key not valid for use in specified state"  I uninstalled and tried reinstalling but same issue.

    For "Key not valid for use in specified state" errors try moving the folder RSA from C:\Users\<User>\AppData\Roaming\Microsoft\Crypto\RSA to say C:\<User>\RSA (just in case there should be a need to restore it) then try installing again. This folder appears to act as a cache and should be rebuilt automatically as required.
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • Hi there, i purchased an app called Top Movies. But when using it on my iPhone to buy movies, it gives me the error 'Your request could not be completed'. Please help.

    Hi there, i purchased an app called Top Movies. But when using it on my iPhone to buy movies, it gives me the error 'Your request could not be completed'. Please help.

    Ok.. I see the app now in iTunes.
    Best thing to do is email the developer of that app.
    You can do that here >  http://www.lymobilesoft.com/contact.html
    Make sure and tell them exactly what the error says: 
    it gives me the error 'Your request could not be completed'.
    Instead of using a third party app, you can download movies directly from the iTunes store.

  • Error positng Invoice using MIRO  - Internal Error  read error SMBEW, Key =

    Hello Friends ,
    User is facing a strange issue while posting a Invoice using MIRO .
    The error says " Internal Error ( Read Error SMBEW, Key = 000000000001011376120000000000 )
    Message no . M8782
    Procedure
    Contact your system administrator
    please provide your valuable inputs .
    thanks,
    Raghu V

    Its a programme error...you have to check & implement SAP note 326826...otherwise contact SAP directly
    Regards,
    Indranil

  • Using gmail with my iphone 4S (7.0.4) I accidentally selected "archive message".  I see no archive folder.  Where can I see/retrieve those emails?

    Using gmail with my iphone 4S (7.0.4) I accidentally selected "archive message" for several emails.  I see no archive folder.  Where can I see/retrieve those archived emails?

    Thank you!  However, those emails, along with all other mail is sent to the All Mail Folder and difficult to track or isolate.  Looking through hundreds of emails at a later time in All Mail to find what I mistakenly designated as archive is very cumbersome.  Why would the system designate an email as archived if it has no dedicated location?

  • Import Manager 'Error 5611520 - Error Saving Key Mapping'

    I am using CREDITOR_EXTRACT in R/3 to send Vendor IDoc to XI and use CREMDM04 type.  XI generates an XML file that I load into MDM using a client that is set up for Inbound/Outbound.  The key mappings have been turned on for the Vendor repository.
    In IM, I use the standard map CREMDM04 and the system maps the incoming XML file to the vendor main table.  There are few values that I have to map manually - fine.  Next, when I click Import, I get a error pop-up message 'Error Saving Key Mapping - Errno 5611520'.
    Has anybody experienced this when using all standard content (schemas and maps) for Vendor?
    Thanks in advance.

    Subbu,
    Found another system that has the same versions as you do.  This particular error did not appear, but we got some internal IM error.  Also, the SAP training demos are on the same versions as mine.
    I am using MDC R/3 as the client and the CREMDM04 schema map.  Not using MDM inbound ports for now.  Just loading XML file generated by XI based on CREMDM04. Do you think that I need to define a Qualified Range for this client in the Console or can it be left blank?
    Thanks.

Maybe you are looking for