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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:56:04+00:00 2026-06-10T02:56:04+00:00

I am getting NSString like this [Hello] [;] [hi] [;] [Its there] [;] [Welcome]

  • 0

I am getting NSString like this

 [Hello] [;]
 [hi] [;]
 [Its there] [;]
 [Welcome] [;]
 [Hello] [;]

i want to convert as a json format, i don’t know how to convert the array of data into json. please help me

  • 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-10T02:56:05+00:00Added an answer on June 10, 2026 at 2:56 am

    You need to use the following code.

    NSDictionary *dict = [myJsonString JSONValue];
    

    If it’s not working then use following

    // 
    // we begin with our string in json format
    //
    NSString *jsonString = [[NSString alloc] initWithString:@"{\"1\":\"1: Rossy Robinson - $25\",\"2\":\"7: Davey Ambrose - $25\",\"3\":\"14: Ross Robinson - $25\"}"];
    
    //
    // convert the json string to an NSMutableDictionary
    //
    NSError *e;
    NSMutableDictionary *JSONdic = [NSJSONSerialization JSONObjectWithData: [jsonString dataUsingEncoding: NSUTF8StringEncoding] options: NSJSONReadingMutableContainers error: &e];
    
    //
    // change a value and add a new value in the dict
    //
    NSLog(@"before: object for key 1 is: %@", [JSONdic objectForKey:@"1"]);
    [JSONdic setObject:@"xxx" forKey:@"1"];
    [JSONdic setObject:@"Phil McQuitty" forKey:@"2"];
    
    //
    //convert dictionary object to json data
    //
    NSData* jsonData = [NSJSONSerialization dataWithJSONObject:JSONdic options:NSJSONWritingPrettyPrinted error:&e];
    
    //
    // convert the json data back to a string
    //
    NSString *jsonText = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];\
    
    //
    // print out the final results
    //
    NSLog(@"back to string: %@", jsonText);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have NSString like this @0,0,0,0,0,0,1,2012-03-08,2012-03-17 . I want values separated by comma. I
I want to create a comma-separated string like this. NSString *list = @iPhone,iPad,iPod; I
Hello I am getting time from NSDate like this: NSDateComponents *hoursAndMinutes = [[NSCalendar currentCalendar]
I have an NSString like this @2010-08-30T11:00:00-04:00 . How to convert this to an
Currently I am getting the values from statement like this: [[NSString stringWithUTF8String:(char *)sqlite3_column_text(ReturnStatement,0)] retain];
Im getting data from a server by executing this code: - (void) sendGeneral:(NSString *)
Getting this out of the way; I don't frequently do much in php or
I know there are a lot of questions on this topic already, but it
// Original // I want to call this guy -(void)addFavorite:(NSString *)favoriteToAdd at, @selector here
I am reading like this... NSString *fileContent = [[NSString alloc] initWithContentsOfFile:path]; SBJsonParser *parser =

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.