Error 3 Unrecognised Leading Character
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Objective-C: JSON Unrecognised leading character? up vote 0 down vote favorite 1 when trying to execute little function to get an array using JSON i get the next message: -JSONValue failed. Error trace is: ( "Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Unrecognised leading character\" UserInfo=0x5d50e30 {NSLocalizedDescription=Unrecognised leading character}" This is the code NSString * payloadAsString = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding]; NSLog(@"%@",payloadAsString); NSMutableArray *jsonArray = [[NSMutableArray alloc] initWithArray: [payloadAsString JSONValue]]; self.loginArray = jsonArray; NSLog prints [["True","1","MTY"]] (as far as i know it should work). Any idea? iphone objective-c json ipad nsmutablearray share|improve this question edited Aug 7 '11 at 19:44 uvesten 2,96421934 asked Aug 7 '11 at 18:36 Hito_kun 3302721 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote accepted I'm not sure which version of the json-framework you are using, but I modified the code to print the offending character: In SBJSONParser.m: - (BOOL)scanValue:(NSObject **)o { ... default: [self addErrorWithCode:EPARSE description:[NSString stringWithFormat:@"Unrecognised leading character (%x)", c[-1]]]; //[self addErrorWithCode:EPARSE description: @"Unrecognised leading character"]; return NO; } You might try setting a breakpoint at that line of code instead. Also, in general, you can try pasting the JSON into JSONLint at http://jsonlint.com/ to see if it validates. Your JSON does validate, though, so your problem is elsewhere. share|improve this answer answered Aug 8 '11 at 3:30 EricS 7,67912329 add a comment| up vote 1 down vote Make sure your string values are using a valid straight double quotation mark character. I've seen people try to copy-paste JSON out of an editor only to have their quotes turned into open-quote close-quote pairs like these: “” share|improve this answer answered Aug 7 '11 at 20:28 cduhn 12.7k23859 Checked, is not that –Hito_kun Aug 7 '11 at 23:06 add a comment| up vote 0 down vote I just had thi
without it enabled. Please turn JavaScript back on and reload this page.All Places > Developers > Native App Developers > ArcGIS Runtime SDK for iOS > DiscussionsLog in to create and rate content, and to follow, bookmark, and share content with other members.Unrecognized leading characterDiscussion created by miribsystematics-co-il-esridist on Oct 10, 2011Latest reply on Aug 22, 2012 by njarecha-esristaff Like • Show 0 Likes0 Comment • 7Hi,I'm using the new iOS API (version 2.0.1).I'me trying to operate IdentifyTask on visible layers in : http://www3.emap.co.il/ArcGIS/rest/services/Clients/NetanyaWater/MapServerThe identify fails and I get http://stackoverflow.com/questions/6974863/objective-c-json-unrecognised-leading-character the error : NSLocalizedDescription=Unrecognized leading character.When I address other services like : http://www3.emap.co.il/ArcGIS/rest/services/Clients/batyam/MapServer, it works fine.Does anyone know why?Thanks,MiriOutcomesVisibility: ArcGIS Runtime SDK for iOS1323 ViewsLast modified on Oct 10, 2011 9:10 AMTags:iosContent tagged with iosnative_app_developersContent tagged with native_app_developersThis content has been marked as final. Show 7 comments7 RepliesNameEmail AddressWebsite AddressName(Required)Email Address(Required, will not be published)Website Addressnjarecha-esristaff Oct 13, 2011 https://geonet.esri.com/thread/37860 11:17 AMI tested the URL mentioned by you for identify task and I see NO error. Could you please provide a sample application to test?Regards,NimeshLike • Show 0 Likes0 Actions miribsystematics-co-il-esridist Oct 16, 2011 11:50 PMNimesh,Sorry. I had an error in my code. I just thought, because of the error message, that the problem is in the service and not in the code.Sorry again...MiriLike • Show 0 Likes0 Actions njarecha-esristaff Oct 18, 2011 8:53 AMNo problem!Regards,NimeshLike • Show 0 Likes0 Actions sunita@octaware.com Aug 16, 2012 3:56 AMI have the same problem Getting the error" Error Domain=org.brautaset.JSON.ErrorDomain Code=3 "Unrecognised leading character" UserInfo=0x602a340 {NSLocalizedDescription=Unrecognised leading character} "Like • Show 0 Likes0 Actions njarecha-esristaff Aug 16, 2012 7:58 AMWhat you are trying to do? When this error happens? Post code to reproduce the error.Regards,NimeshLike • Show 0 Likes0 Actions sunita@octaware.com Aug 22, 2012 3:56 AMI am trying to access the services from vpn server. When i am logged in to vpn server and run iphone application I got this errorError msg:Error Domain=org.brautaset.JSON.ErrorDomain Code=3 "Unrecognised leading character
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
SQL Server 2014 Express resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: iPhone Sample Questions. Microsoft Sync Framework > SyncFx – Microsoft Sync Framework Toolkit Question 0 Sign in to vote Hi all, I am trying to use the iPhone sample that uses core data from preview v3 , and am trying to play with it to see how this all comes together. So I can then add to my existing App. I have the ListService( from v4 CTP) running on Win 7 IIS, and I can run the iPhone app and login, and Manage the list and items. Here are a few things that I noticed were not polished in the example and I need a little assistance on. 1. To add an item you have to select a Priority & Status but when the iPhone app runs it does not populate these tabes in the core data. I opened the SQL light file directly and added these records based on what I saw in the tables in the MS Sql servers tables. 2. Your comments in Sync Controller.m state that the syncBlog will be empty the first sync. This causes a problem in Util.M in GetODataJsonPayload, because when you try to populate your mainDict with .....dictionaryWithObjects:[NSArray arrayWithObjects:[NSNumber numberWithBool:false], serverBlob, nil] .... Because serverBlob is null or nil the first time, you get the error *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSPlaceholderDictionary initWithObjects:forKeys:]: number of objects (1) not equal to number of keys (2)' This is because when you pass a nil object, like serverBlob in this case, Obj-c thinks thats the end of the array list, and doesn't add the nil object so one array has 2 objects and one has 1. So Sync wont start, thus the error above I added code to detect if serverBlog was nil and change it to a NSNull, this helped sync