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

The Archive Base Latest Questions

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

In my code I have an item that is a list of alternating strings

  • 0

In my code I have an item that is a list of alternating strings and images that I wish to save. I know how to save individual images in their JPEG representations, but is there a simple and efficient way I don’t know of in Objective-C to save all these items (or at least the images since I can handle the strings myself) while maintaining their order?

ex: item 1 (“hi”, image, “how”, image, “are”, image), item2(“this”, image, “is”, image)

maintaining item order is not important to me, but the order in the list is. The first thing that comes to mind is simply to save every single image, and have an algorithm to create then remember their imagename and then save and load the text list. Is there an easier way to do this? Can I literally just save the array itself as a plist and be on my merry way? (i’ve only seen examples of these with strings)

  • 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-28T02:14:59+00:00Added an answer on May 28, 2026 at 2:14 am

    I believe I understand what you’re going for. You’d like to save an array of items, each of which contains an array of Objects that contain an image and a string. If this is accurate then you’re idea of saving the array to a plist is correct.

    In short you would create NSDictionaries of your Objects and save the array of them. Like so:

    In your object you’ll have a method similar to this:

    - (NSDictionary *)dictionaryOfItemData;
    {
        NSMutableDictionary * mutableDictionary = [[NSMutableDictionary alloc] init];
    
    
        [mutableDictionary setObject:imageName 
                              forKey:@"imageName"];
    
        [mutableDictionary setObject:UIImagePNGRepresentation([self image]) 
                              forKey:@"imageData"];
    
    
        return mutableDictionary;
    }
    

    Then you would save an array of these (or array of arrays, or whatever your desire based on file size concerns, need to load, etc.) like so in the proper place:

    [[arrayOfDictionaries description] writeToFile:path
                                        atomically:YES 
                                          encoding:NSUTF8StringEncoding 
                                             error:NULL];
    

    Which gives you the plist, that you can load and hydrate by creating your image with data and setting the image name from the dictionary.

    ~Good Luck

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

Sidebar

Related Questions

I have some code that inserts a list item into a list... I then
I have the following code: SPList list = web.Lists[this.ListName]; SPListItem item = list.Items.Add(); now
I have the following list item that I want to append an 'Edit Settings'
I have a list item that when hovered upon slides down another inner list.
I have code that adds list items to an unordered list, and associated with
Hello I have a item list that shows on my asp.net page like this:
I have a big item list that I wanted to hide, and then a
I have this code $(.delete2).click(function() { $('#load2').fadeIn(); } I have dynamically added item via
I have following code: private void ProcessQueue() { foreach (MessageQueueItem item in GetNextQueuedItem()) PerformAction(item);
Hi I have the code below, once the first (only) item in the menu

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.