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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:51:19+00:00 2026-06-09T19:51:19+00:00

I have a .net webservice which returns a Json data in this format: NSDictionary

  • 0

I have a .net webservice which returns a Json data in this format:

        NSDictionary *json = [NSJSONSerialization JSONObjectWithData:dataPlist options:NSJSONReadingMutableContainers error:&errorJson];

[
{
    "MEMBERID": "xxx",
    "PREFIXINFORMAL": "Mr.",
    "FIRSTNAME": "xxx",
    "MIDDLENAME": "xxxx",
    "LASTNAME": "xxxx",
    "SUFFIX": xxxx
}

]

My code to save this NSDictionary to plist:

            NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        NSString *path = [documentsDirectory stringByAppendingPathComponent:@"boardMemberInfo.plist"];
        NSDictionary *test = [NSDictionary dictionaryWithObject:@"test" forKey:@"test"];
        for(NSDictionary *item in json) {
            BOOL success = [item writeToFile:path atomically:YES];
            if(success) {
                NSLog(@"Success Saving New plist");
            } else {
                NSLog(@"Failure Saving New plist");
            }
        }

Neither [item writeToFile…] nor [json writeToFile…] works. However, simple [test writeToFile…] works. What am I missing?

Thanks,

  • 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-09T19:51:21+00:00Added an answer on June 9, 2026 at 7:51 pm

    Best thing you could do is to decompose your saving process and use NSError to understand what the problem is:

        for(NSDictionary *item in json) {
            NSError *error;
            NSData *serializedData = [NSPropertyListSerialization dataWithPropertyList:item format:… options:… error:&error];
            if (!serializedData) { NSLog(@"Can't serialize data: %@", error); continue; }
            if (![serializedData writeToFile:path options:… error:&error]) {
                NSLog(@"Can't write to %@: %@", path, error);
            } else {
                NSLog(@"Success Saving New plist");
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webservice (.NET) which returns JSON result. The iOS application consumes that
I have an ASP .Net Webservice which returns a System.Data.DataTable like object (contains rows
.NET Web Service I have a .NET web service which returns json formatted DateTime's.
We have a .NET web service which returns JSON, including a date in string
I have a .NET webservice which I need to hit asynchronously from the jQuery
I have an ASP.NET Webform which currently calls a Java WebService. The ASP.NET Webform
I have a webservice programmed in coldfusion which I'm attempting to consume using c#.net.
I have an ASP.NET WebService that returns an object of List public class Students
I'm developing an asp.net webservice application to provide json-formatted data to a widget that
I am developing an Windows phone7 application, I have a .NET webservice that returns

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.