Parse issue after importing AFNetworking and UIKIT+AFNetworking - afnetworking-2

I am getting getting 8 parse issues in Xcode after importing AFNetworking and UIKIT+AFNetworking from the master release. I haven't done anything yet, just used #import AFNetworking.h and received following errors on this line in AFHTTPRequestOperationManager.h
#property (readonly, nonatomic, strong) NSURL *baseURL;
The errors are:
/workspace/MD/AFNetworking/AFHTTPRequestOperationManager.h:90:48: Expected member name or ';' after declaration specifiers
/workspace/MD/AFNetworking/AFHTTPRequestOperationManager.h:90:1: Property requires fields to be named
/workspace/MD/AFNetworking/AFHTTPRequestOperationManager.h:90:48: Expected ';' at end of declaration list
/workspace/MD/AFNetworking/AFHTTPRequestOperationManager.h:90:48: Expected an Objective-C directive after '#'
I'm also receiving the same errors in AFHTTPSessionManager.h. I am not using any of the classes yet, and am still getting these errors. Can someone please explain what am I doing wrong?

had a same name constant which was causing the error

Related

parcel2 error with valid JSON: "#parcel/transformer-json:" JSON5: invalid end of input at 1:1

Not sure why I'm getting this error -- I'm using default configuration specs for parcel2, so it should work out of the box according to the documentation.
I've validated the JSON object and it seems to be valid, so this is a bit of a head scratcher.
None of the config/rc files are incorrectly formatted or empty, either.
It appears as though this was a bit of a silly error -- while the JSON object was valid, the JSON file needed a carriage return (enter at the end of the file) in order to be read correctly by the parcel transformer.

ijson fails with trailing garbage parse error

for prefix, event, value in parser:
print(prefix)
I get the following error after executing the above code , I dont understand what the error is.
ijson.common.IncompleteJSONError: parse error: trailing garbage
nt":19485,"verified":false}} {"user_id":1408970940,"id":4496
(right here) ------^
Seems you are trying to parse a JSON document with more than one top-level object, which is not standard. ijson allows for this though if you give the multiple_values=True flag to the method you are using.

pSConfig JSON is not valid. Encountered the following validation errors:

When I create jason file the first time it gives me some error as
Error retrieving JSON. Encountered the following error:
garbage after JSON object, at character offset 8 (before ": {\r\n \r\n"...") at /usr/share/perl5/vendor_perl/JSON.pm line 171.
Then I tried to fix it and check it from the website
When I upload it a gain it gives me
pSConfig JSON is not valid. Encountered the following validation
errors: Node: / Error: Properties not allowed: cck.nnu.tn,
psauhank1.ankabut.ac.ae, aub-asren-ps.aub.edu.lb,
ps.ams-van1G.kaust.edu.sa, 1ge-throughput, 185.19.231.230,
193.227.1.143, perfsonardmz.marwan.ma, ps.sc-bdc10G.kaust.edu.sa, perfsonar.marwan.ma.
I don't know what is the problem and how I fixed it
the first time I missed the character but the second I don't know what is the reason
I checked it on JSON validator

how to escape special character '?' while inserting into memsql

I am trying to insert JSON payload into memsql JSON type column but it is failing due to the following reason.
My JSON content having '?' character.
I tried to escape '?' by using the following ways, but it doesn't worked for me.
The Exception i am getting is:
Root Exception stack trace:
java.lang.IndexOutOfBoundsException: Index: 0
Ex payload: "question mark content?"
1. #[org.mule.util.StringUtils.replace(payload,"?","\\?")]
Result: "question mark content\?"
2. #[org.mule.util.StringUtils.replace(payload,"?","\?")]
Result: not allowed to use the above expression
If i use the payload "question mark content" then it is inserted successfully.
Please help me how can I escape '?' in my JSON content while saving it into memsql?
'\?' itself is an escape sequence, so achive this you have to use "\\?" which produce "\?" which should work with memsql.
#[org.mule.util.StringUtils.replace(payload,"?","\\\\?")]
Hope this helps.
From the looks of your exception it looks like you are calling for it to replace the payload, but you're not assigning it to anything.
Going off of the documentation at:
http://grepcode.com/file/repo1.maven.org/maven2/commons-lang/commons-lang/2.4/org/apache/commons/lang/StringUtils.java#3457
It basically says that it's trying to replace the items in a string, and the method itself returns a string. Based on what I can tell in the stack trace, it seems as though you are passing a null or uninitialized variable to something that's trying to parse str[0], which is returning an array out of bounds error.
The way to correct this would be to do something like:
payload = org.mule.util.StringUtils.replace(payload,"?","\\\\?")
Which should replace any instance of ? with \? and re-write it to the payload variable. That said, it sounds like payload may actually be null when you're evaluating it later in your program, which could be indicative of a larger issue.

how to prevent \r\n and the likes in JSON string

I am getting text from MySQL via a laravel model and converting the content to JSON. Unfortunately the text contains new lines and carriage returns, is there any way to get the contents properly escaped?
Article::find(1)->toJSON();
Gives me an Ajax/JSON error in my view so I was wondering where the problem is. Am I either storing the content the wrong way or am I retrieving it the wrong way?
Thanks.
This is the JSON string I am getting for a test article:
{"id":22,"short_title":"Another test article","long_title":"Longer title for the test article mention in the short title","description":"This article describes a computer classroom where strange things happen and stuf","content":"This is a test article and I think this will generate the error I am looking for. <\/p>\r\n\r\n Maybe or maybe not. <\/p>\r\n","deleted_at":null,"created_at":"2014-04-25 09:10:45","updated_at":"2014-04-25 09:10:45","category_id":1,"zenra_link":"","published_on":null,"published":1,"source_url":"http:\/\/blog.livedoor.jp\/morisitakurumi\/archives\/51856280.html","source_title":"Some source article","source_date":null,"slug":"another-test-article","view_count":0}
The content portion is generated by a textarea that's running CKEditor and it gets saved to a MySQL MEDIUMTEXT field.
Next thing I do is that I inject this into my view to populate my backbone views like this:
<script>var initialData = JSON.parse('{{ $cJson }}');</script>
And that's where the console tells me: Uncaught SyntaxError: Unexpected Token. As suggested I tested the above string on jsonlint.com and it comes back as valid.
I figured out the problem:
<script>var initialData = JSON.parse('{{ $cJson }}');</script>
This is where the error happens. JSON.parse freaks out on the string I supply. If I remove JSON.parse it works like this:
<script>var initialData = {{ $cJson }};</script>
No more unexpected token errors. I was on the wrong track with the problem because I read on so many places that the carriage returns and new lines produce errors in the JSON format.