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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:13:15+00:00 2026-05-31T14:13:15+00:00

I am saving a NSMutableArray with different objectsForKeys. I am having Three of the

  • 0

I am saving a NSMutableArray with different objectsForKeys.
I am having Three of the object be set by input by the user.
I would like to be able to append the new object text with .caf and .txt. So when these are called in the next viewController they can be recognized and used.

Here is my code:

- (void)saveAction:(id)sender {

    [self.nameTextField resignFirstResponder];
    [self.imageNameTextField resignFirstResponder];

    NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:


                                       @"main.caf",@"pictureAudioKey",
                                       @"audio1.m4a",@"firstAudioKey",
                                       @"audio2.m4a",@"secondAudioKey",
                                       @"audio3.m4a",@"thirdAudioKey",
                                       @"audio4.m4a",@"fourthAudioKey",
                                       @"audio5.m4a",@"fifthAudioKey",
                                       @"audio6.m4a",@"sixthAudioKey",
                                       @"main.jpg",@"photoimagekey",
                                       @"some.txt", @"identity", 
                                       @"imagename.txt",@"numberkey",nil];

 //here is where I change the object values by what the user puts into   the textfield imagename.text 
This works fine especially for the photo since it is recognized as a png without the extension and loaded 
    [dictionary setObject:[[self imageNameTextField]text]
                   forKey:@"photoimagekey"];
//However when you strip the .txt from a text file...or the .caf from an audio //file they are not recognized and not loaded.
    [dictionary setObject:[[self imageNameTextField]text]
                   forKey:@"identity"];
//I tried this
//identity=[identity stringByAppendingFormat:@"txt" But it didn't work

    NSString *audioString = [dictionary objectForKey:@"pictureAudioKey"];
    audioString = [audioString stringByAppendingFormat:@".caf"];
    [dictionary setObject:[[self imageNameTextField]text]
                   forKey:@"pictureAudioKey"];

Does anyone have any suggestions?

  • 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-31T14:13:16+00:00Added an answer on May 31, 2026 at 2:13 pm

    Change:

    [dictionary setObject:[[self imageNameTextField]text]
                   forKey:@"identity"];
    

    to:

    [dictionary setObject:[NSString stringWithFormat:@"%@.txt", [[self imageNameTextField] text]] 
                   forKey:@"identity"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble saving a new row in the DataGridView back to the database.
When saving data in different sql tables, is it best to use the GUID
My Java application is saving stuff in 'user.home' but on windows this does not
I am saving all the words from a file like so: sentence = fileName
I am saving an NSMutableArray in a Transformable property in my Core Data store.
I'm quite new with Core Data, and I'm having an issue that I don't
I'm saving some data using a series of NSDictionaries, stored in an NSMutableArray and
I am saving an array of custom objects to a plist list file like
I want the user to be able to create polygons after placing some (unknown
I am getting data from NSTextField, and saving data in NSMutableArray. I want to

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.