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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:24:57+00:00 2026-06-15T19:24:57+00:00

I have an NSMutableArray created storing song names and artists. I am trying to

  • 0

I have an NSMutableArray created storing song names and artists. I am trying to convert this array to NSData format so that I can save it to a text file. When attempting to do so, the output I get is unreadable:

bplist00ÔghX$versionX$objectsY$archiverT$top † ¯$
!”)-./3459:;?@AEFGKLMQRSWXY]^_cU$nullÒ
R$0V$class€€#Ò
ZNS.objectsª€€€
€
…etc.

The code I’m using to convert from an NSMutableArray to NSData is:

NSFileManager *fm;

NSData *dataCache = [NSKeyedArchiver archivedDataWithRootObject:myList];

fm = [NSFileManager defaultManager];

if ([fm createFileAtPath:@"/users/nicholasvogler/desktop/Mysongs.txt" contents:dataCache  attributes:nil] == NO)

    {
        NSLog (@"Could not create data file");
        return 1;
    }

All objects in the array are NSStrings and I’ve added the following method for the strings and the array:

-(void) encodeWithCoder:(NSCoder *)encoder
{

    [encoder encodeObject: songname];
    [encoder encodeObject: artist];
}
  • 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-15T19:24:59+00:00Added an answer on June 15, 2026 at 7:24 pm

    What exactly are you expecting the output to be? What you have there is a binary plist. That’s what archived data (e.g. NSKeyedArchiver) emits. There’s an XML format as well, which can be accessed via NSPropertyListSerialization, although nobody uses the XML format for archived data because the actual plist representation is an implementation detail.

    So despite the fact that it’s an unreadable binary blob to you, it still encodes what you want, and you can decode it again with NSKeyedUnarchiver.

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

Sidebar

Related Questions

I have an array that gets created from JSON. The array looks like this:
I have created a class which has a static NSMutableArray, I want this array
I have a NSMutableArray (called listOfSites) that is created and used in classA.m. I
Hope you can help. I have created my own Custom UIView and I'm trying
I have an NSMutableArray of names. I want the pass the data (selected name)
I have an NSMutableArray that is populated with objects of strings. For simplicity sake
I'm have a little bit of trouble storing and accessing a multidimensional array from
I have an array of objects that I want to save as a file
I'm trying to convert this Javascript code: self.userSerialEvent = function (join, value, tokens) {
I have function named: - (void) AddSortedCustomFeed :(NSMutableArray*) rssList; this function adds items(Articles) from

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.