Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6072753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:11:41+00:00 2026-05-23T10:11:41+00:00

I have read on another post ( Archiving / Unarchiving results in initForReadingWithData incomprehensible

  • 0

I have read on another post (Archiving / Unarchiving results in initForReadingWithData incomprehensible archive) that you can’t store more than 250kBytes on a NSMutableArray. Unfortunately, in order to recover such data with NSKeyedUnarchiver, you must use a NSMutableArray. I am trying to get back an image with a size around 500kB.

  MTMessage *message = [NSKeyedUnarchiver unarchiveObjectWithData:data];

The error I get is :

Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0x0, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x0, 0x1)’

Apparently it’s a pretty common situation (even-though i have not found a solution yet). Would you have any idea of how to bypass the use of NSMutableData.
Thank you.

EDIT : Actually it says that data has a size of 524 288 bytes, which is correct, so the problem might come from the unarchiver.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:11:42+00:00Added an answer on May 23, 2026 at 10:11 am

    NSKeyedArchiver does not depend on an NSArray (immutable or not).

    I’m also not aware of a bug correlated with NSKeydArchiver and depending on archive size.

    The following code runs fine on Lion:

    NSMutableData *data = [NSMutableData data];
    for (uint32_t i = 0; i < 1024 * 1024; ++i)
        [data appendBytes:&i length:sizeof(uint32_t)];
    
    NSData *archive = [NSKeyedArchiver archivedDataWithRootObject:[NSMutableArray arrayWithObject:data]];
    NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:archive];
    
    assert([data isEqual:[array lastObject]]);
    

    Please provide more code for more insight in your actual problem. Are you maybe trying to unarchive an encoded image instead of an archive?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read on another post ( how to dismiss action sheet ) that
I have read a lot that LISP can redefine syntax on the fly, presumably
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can
I have read through Scott Hanselman's post on this topic. I found another article
I had read in another post here on SO that when possible you shouldn't
there is no practical way that i can see or have read about that
I have read another post/question regarding jquery variables and it was useful but I'm
I have a string read from another source such as \b\bfoo\bx. In this case,
I am trying to read a global symbol from another package. I have the
I have read that using database keys in a URL is a bad thing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.