sbjson

SBJSON parsing issue with Twitter's GET trends/:woeid

一笑奈何 提交于 2020-01-06 19:44:17
问题 I am trying to understand an issue I am having when using sbjson to parse the following json returned by a call to Twitter's GET trends/:woeid I am using the following URL: @"http://api.twitter.com/1/trends/1.json" and I get the following response: (truncated to save space) [ { "trends": [ { "name": "Premios Juventud", "url": "http://search.twitter.com/search?q=Premios+Juventud", "query": "Premios+Juventud" }, { "name": "#agoodrelationship", "url": "http://search.twitter.com/search?q=

Another iPhone Memory leak issue

喜夏-厌秋 提交于 2020-01-06 08:43:19
问题 I have memory leak on jsonParser. Here is my code - (id) objectWithUrl:(NSURL *)url { SBJsonParser *jsonParser = [SBJsonParser new]; NSString *jsonString = [self stringWithUrl:url]; // Parse the JSON into an Object return [jsonParser objectWithString:jsonString error:nil]; } This is the error message I'm getting, potential leak of an object allocated on line 192 and stored into 'jsonParser' Please help. 回答1: +new is equivalent to the [[SBJsonParser alloc] init] call so you're responsible to

“JSONValue” Keyword not getting recognised while using SBJson ?

為{幸葍}努か 提交于 2020-01-01 15:33:34
问题 i have copied SBJson folder into my project and also #import "SBJson.h" But still i am not getting NSDictionary *result = [strResult JSONValue]; Even Xcode does not show any option JSONValue ; even if i write JSONValue than it prompt me error No visible @interface for 'NSString' declares the selector 'JSONValue' 回答1: You don't need SBJson for this. There is a native class NSJSONSerialization that does this much faster and without the need to import anything. NSDictionary *result =

“JSONValue” Keyword not getting recognised while using SBJson ?

烂漫一生 提交于 2020-01-01 15:33:30
问题 i have copied SBJson folder into my project and also #import "SBJson.h" But still i am not getting NSDictionary *result = [strResult JSONValue]; Even Xcode does not show any option JSONValue ; even if i write JSONValue than it prompt me error No visible @interface for 'NSString' declares the selector 'JSONValue' 回答1: You don't need SBJson for this. There is a native class NSJSONSerialization that does this much faster and without the need to import anything. NSDictionary *result =

Replace tab in NSString with \t

北战南征 提交于 2019-12-31 03:03:13
问题 I'm parsing json with SBJson. I receive an error "-JSONValue failed. Error is: Unescaped control character [0x09]" when parsing my json string, it has unencoded tab. How to replace this tab in my json string to \t? If i remove tab manualy, everything is good. Or how to encode this tab properly? 回答1: You can use stringByReplacingOccurrencesOfString:withString: : NSString * newJsonString = [oldJsonString stringByReplacingOccurrencesOfString:@"\t" withString:@"\\t"]; 来源: https://stackoverflow

Using ARC library in non-ARC project [closed]

痴心易碎 提交于 2019-12-25 19:02:12
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . ARC technology isn't being used in my project. I'm trying to add SBJson library to it. I set -fobjc-arc flag for all files which have SBJson prefix, but during compilation process ARC semantic issue (Pointer to

Using ARC library in non-ARC project [closed]

我的梦境 提交于 2019-12-25 19:01:17
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . ARC technology isn't being used in my project. I'm trying to add SBJson library to it. I set -fobjc-arc flag for all files which have SBJson prefix, but during compilation process ARC semantic issue (Pointer to

How to parse a JSON having no quotes with its KEY string?

只谈情不闲聊 提交于 2019-12-23 13:07:32
问题 I want to parse the json output resulting from the following url in SBJSON framework for iOS http://maps.google.com/maps?q=school&mrt=yp&sll=13.006389,80.2575&output=json while(1);{title:"school - Google Maps",url:"/maps?q=school\x26mrt=yp\x26sll=13.006389,80.2575\x26ie=UTF8\x26hq=school\x26hnear=",urlViewport:false,ei:"RCu3T4eeMqSiiAe7k-yZDQ",form:{selected:"q",q:{q:"school",mrt:"yp",what:"school",near:""},d:{saddr:"",daddr:"",dfaddr:""},geocode:""}, I am using http://www.bodurov.com

how to parse a JSON string in iphone Objective - C?

丶灬走出姿态 提交于 2019-12-22 01:31:23
问题 Hi i am trying to parse a JSON string in iphone and so far i have been able to get JSON VALUE correctly but after that i am geting an error: -[__NSArrayM objectForKey:]: unrecognized selector sent to instance 0x62242e0 2011-08-16 16:11:58.792 BleepBleep[4083:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM objectForKey:]: unrecognized selector sent to instance 0x62242e0' *** Call stack at first throw: ( 0 CoreFoundation 0x010a9be9 _

JSON Parse Error

匆匆过客 提交于 2019-12-20 05:28:55
问题 I am using SBJson framework (also known as json-framework) for the iOS. When parsing a certain JSON file, I am getting the following error: -JSONValue failed. Error is: Unescaped control character [0x09] ' I have used this framework many times and I am also parsing a very similar JSON file (that is even much longer) in that same app and it's working fine. I tried throwing around a bunch of NSLogs and everything seems to be fine. Can someone please point me to what this error means, or at