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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:49:49+00:00 2026-06-10T11:49:49+00:00

I am trying to parse this string …. but due to message_of_the_day key ,

  • 0

I am trying to parse this string …. but due to “message_of_the_day” key , JSON is not able to recognize the string as it contains newLine characters (\n).How would I parse this JSON string, rest of all JSON webservices works fine for me.

Json Response :

{"tblMessageOfTheDay":[{"customer_id":"1659","application_id":"1001","message_of_the_day":"Set your Message



GDSFSFDS
SF
ADS
DSFS
F"}]}

Code :

I gave lot of try to solve out this issue…..but still having the same problem.

-(void)DataCollectedSuccessfully:(NSString *)responseString
{

     NSDictionary *results = [responseString JSONValue]; // Main code .. with didn;t work
    id result = [responseString JSONValue]; // I tried for it, it that object won;t get recognized, but this trick didn't work.
    NSLog(@"%@",result);

    NSDictionary *results = [[responseString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] JSONValue]; // Even tried to remove the newLine characters & extra space.

 }

Error :

-JSONValue failed. Error trace is: (
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=5 \"Unescaped control character '0xa'\" UserInfo=0x6235db0 {NSLocalizedDescription=Unescaped control character '0xa'}",
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key: message_of_the_day\" UserInfo=0x6224a50 {NSUnderlyingError=0x6235e00 \"Unescaped control character '0xa'\", NSLocalizedDescription=Object value expected for key: message_of_the_day}",
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Expected value while parsing array\" UserInfo=0x6224a80 {NSUnderlyingError=0x6235d20 \"Object value expected for key: message_of_the_day\", NSLocalizedDescription=Expected value while parsing array}",
    "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Object value expected for key: tblMessageOfTheDay\" UserInfo=0x6224af0 {NSUnderlyingError=0x6224ab0 \"Expected value while parsing array\", NSLocalizedDescription=Object value expected for key: tblMessageOfTheDay}"
)
  • 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-10T11:49:51+00:00Added an answer on June 10, 2026 at 11:49 am

    There is just a simple way which worked for me.
    The problem was with the posting the data from iPhone, if I use to enter some new line character, it creates the problem & more on, the same data was required to be shown on website too ,thats tried to replace the \n with
    tag as , it can be easily parsed at website too.

    Here is the code snippet :

    [[messageView text] stringByReplacingOccurrencesOfString:@"\n" withString:@" br "];
    

    I need to use br since the same web service data need to be used in website too.

    I am not sure about the way of doing this, but yes It solved my problem at both ends i.e Website as well as in iPhone.

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

Sidebar

Related Questions

I'm trying to parse this string into java, but I keep getting errors. {id:1,jsonrpc:2.0,result:{limits:{end:3,start:0,total:3},sources:[{file:/media/storage/media/re
I'm trying to parse a string but I'm not sure how to parse it
I'm trying to parse this XML string: <?xml version=1.0 encoding=UTF-8 standalone=no?> <response type=success> <lots>
I'm trying to parse apart a string like this with javascript: var mystr =
I'm trying to parse this JSOn with multiple entries of node tag: { nodes:
Trying to parse some XML but apparently this is too much for a lazy
I trying to parse this string: $right = '34601)S(1,6)[2] - 34601)(11)[2] + 34601)(3)[2,4]'; with
I am trying to parse a string which in JSON format only that keys
I'm trying to parse a string containing milliseconds like this: string s = 11.05.2010
I have this string: {\time\:1327220746000,\long\:14.382638525754006,\acc\:35,\alt\:326,\lat\:50.07442396194751} and while trying to parse it with json_decode in

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.