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

  • Home
  • SEARCH
  • 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 8808197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:33:40+00:00 2026-06-14T02:33:40+00:00

I have the following code to load some files and save them to disk:

  • 0

I have the following code to load some files and save them to disk:

NSDictionary *dictionary = [NSKeyedUnarchiver unarchiveObjectWithData:[NSData dataWithContentsOfURL:url]];
// THE LINE BELOW IS WHERE THE EXCEPTION OCCURS
NSMutableArray *paths = [[NSMutableArray alloc] initWithArray:[NSKeyedUnarchiver unarchiveObjectWithFile:[dictionary objectForKey:@"paths"]]];

if(dictionary)
{

    dispatch_async(dispatch_get_main_queue(), ^{

    NSLog(@"DOWNLOADED PATHS: %@", paths);

    NSFileManager *filemgr;
    NSString *docsDir;
    NSArray *dirPaths;

    filemgr = [NSFileManager defaultManager];

    dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

    docsDir = [dirPaths objectAtIndex:0];

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

    for(NSObject *obj in paths)
    {

        NSString *identification = [defaults objectForKey:@"LatestID"];

        NSString *pageno = [NSString stringWithFormat:@"%i", [paths indexOfObject:obj]];
        NSString *name = [NSString stringWithFormat:@"%@paths%@.archive", identification, pageno];

        NSString *dataFilePath = [[NSString alloc] initWithString: [docsDir
                                                                    stringByAppendingPathComponent:name]];

        [NSKeyedArchiver archiveRootObject:paths toFile:dataFilePath];

    }

    });

}

However, when I run this code, the following exception appears:

enter image description here

* Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSArrayM getFileSystemRepresentation:maxLength:]: unrecognized selector sent to instance 0xc8809e0’
*
First throw call stack:
(0x3623012 0x3448e7e 0x36ae4bd 0x3612bbc 0x361294e 0x2e2d7b4 0x2e2d762 0x2e5bc85 0x2e83c7a 0x8d98 0x406053f 0x4072014 0x40632e8 0x4063450 0x95336e12 0x9531ecca)
libc++abi.dylib: terminate called throwing an exception
(lldb)

Why is this happening?

  • 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-06-14T02:33:42+00:00Added an answer on June 14, 2026 at 2:33 am

    It seems that [dictionary objectForKey:@"paths"] on the suspicious line contains an NSMutableArray instead of an NSString. Perhaps you meant [[dictionary objectForKey:@"paths"] objectAtIndex:0] instead.

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

Sidebar

Related Questions

I have the following code in my application to load some data from my
I have the following code layout <script src=http://some.javascript/file.js></script> // This should load first <script
i have the following code to try and load a local html page in
I have the following code - it is used to load a drop down
I have the following code: $(function () { $(#ARO).load('/DA.aspx?section=ARO #ARO', function() { DoSomething1(); });
I have the following code, which I want to load values on a selection
I have the following code, in which Boost.Local uses a function callback to load
I have used the following code in a number of applications to load .DLL
I have written the following code, CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); report.Load(@C:\Users\XXX\Desktop\Backup1\Project\ReportsFolder\ReportSalesInvoice.rpt); Report works
Some people have told me that the following code is bad for HTML validation:

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.