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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:13:57+00:00 2026-06-03T21:13:57+00:00

In my app I upload data using JSON in the following way: NSMutableDictionary *titles

  • 0

In my app I upload data using JSON in the following way:

NSMutableDictionary *titles = [NSMutableDictionary dictionary];

for (UITextField *textField in messagename)
{
    [titles setObject: textField.text forKey: @"title"];
    // as you can see, here you're replacing the value @ at key "title" with a new object on every pass
}

NSMutableDictionary *message = [NSMutableDictionary dictionary];
for (UITextField *textField in messagetext)
{
    [message setObject: textField.text forKey: @"title"];
    // as you can see, here you're replacing the value @ at key "title" with a new object on every pass
}

NSMutableDictionary *all = [NSMutableDictionary dictionary];

for (UITextField *textField in messagename)
{
    [all setObject: titles forKey: message];
    // as you can see, here you're replacing the value @ at key "title" with a new object on every pass
}

NSString *jsonString = [all JSONRepresentation];
NSData *jsonData = [jsonString dataUsingEncoding: NSUTF8StringEncoding];

[jsonData writeToFile: getImagePath atomically: YES];


NSString *destDir = @"/sandbox/";
[[self restClient] uploadFile:filename toPath:destDir
                withParentRev:nil fromPath:getImagePath];

the only problem is that only the text for the last created table is uploaded, not all. I used the tags with cases, but it was too long , and If an object was nil, the app crashed.
Also, I can only upload “message”, or “message name” separately with this result:

{"title":"Untitledjjjj"}

The whole purpose of the “all” was to have something like: message1 (main key) with under key title, with corresponding title, and message with corresponding message. then message2…

How can I do this?? If I upload all the result is {}

  • 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-03T21:13:58+00:00Added an answer on June 3, 2026 at 9:13 pm

    You are using the same key all the time.. probably you should use an array instead for both titles and message.

    I will just fix the first part, that should be enough:

    NSMutableArray *titles = [NSMutableArray array];
    
    for (UITextField *textField in messagename)
    {
        // add textfield contents to array
        [titles addObject: textField.text];
    }
    

    Do you get it? In a dictionary, one key can only have one value. So you are always replacing the contents with each call of [dicitonary setObject: ... forKey: @"title"];

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

Sidebar

Related Questions

I managed to upload files on App-Engine by using the following example: How to
im building a file upload/dwnload app in php..im using the following form <html> <head>
self.response.out.write(\n) When i upload a data of multiline using text property and then printing
I'm trying to upload some data to my App Engine datastore using the bulkuploader.
I have an app that allows users to upload large data files and then
I upload my app to app store, I already build my apps using device
I am trying to upload my app's updates via Xcode to itunesconnect using this
I am trying to upload my GAE app using the console in windows. I
I'm having trouble getting JSON data from my Rails app to display on a
I'm trying to upload some records to my local data store using appcfg.py Only

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.