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 4234570
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:22:28+00:00 2026-05-21T02:22:28+00:00

I am fairly new to archiving an object I have. I have a dictionary

  • 0

I am fairly new to archiving an object I have. I have a dictionary that I want to archive.. so first I got the path by doing:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        dictionaryPath = [paths objectAtIndex:0];

so is the next step to append this dictionaryPath with a .txt? Or should I create something first at this directory? What is then the data type?

I want to be able to use it for:

[NSKeyedArchiver archiveRootObject:locationDic toFile:dictionaryPath];

Where dictionaryPath is the path to store this NSDictionary

  • 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-21T02:22:29+00:00Added an answer on May 21, 2026 at 2:22 am

    NSSearchPathForDirectoriesInDomains will give you an array of directory paths. So if you take the first one, you need to append a filename (whatever filename you’d like, with whatever extension you’d like), and then use that path as the location to write out to.

     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
     NSString *documentsDirectory = [paths objectAtIndex:0];
     NSString *dictionaryFilePath = [documentsDirectory stringByAppendingPathComponent:@"Filename.extension"];
     [NSKeyedArchiver archiveRootObject:locationDic toFile:dictionaryFilePath];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm fairly new to ruby and I've got a hash that looks like so:
Fairly new to Google Maps API. I've got an array of data that I
Im fairly new to android dev and I want to build an app that
Fairly new to wpf, using the galasoft mvvm templates. I have two relaycommands that
I fairly new to JQuery and perhaps trying to achieve something that might be
I am new to fairly new to AS3 and I have found myself needing
I am fairly new to php and mysql but I have created a small
I'm fairly new to C++ standard library and have been using standard library lists
Fairly new to MVC3 and I am doing a simple project for testing purposes.
Being fairly new to C++ I have a question bascially concerning the g++ compiler

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.