From 573a7d90f67f856546cccbfb7137360b4d7ba712 Mon Sep 17 00:00:00 2001 From: dmaclach Date: Tue, 13 Nov 2018 12:46:52 -0800 Subject: Deprecate GTMNSScanner+JSON (#199) Use NSJSONSerialization instead. --- Foundation/GTMNSScanner+JSON.h | 12 ++++-------- Foundation/GTMNSScanner+JSONTest.m | 6 ++++++ 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'Foundation') diff --git a/Foundation/GTMNSScanner+JSON.h b/Foundation/GTMNSScanner+JSON.h index 0ff8e65..553e3df 100644 --- a/Foundation/GTMNSScanner+JSON.h +++ b/Foundation/GTMNSScanner+JSON.h @@ -23,16 +23,12 @@ // Grabs the first JSON Object (dictionary) that it finds and returns it // in jsonString. We don't parse the json, we just return the first valid JSON -// dictionary we find. There are several other JSON parser packages that -// will actually parse the json for you. We recommend json-framework -// http://code.google.com/p/json-framework/ -- (BOOL)gtm_scanJSONObjectString:(NSString **)jsonString; +// dictionary we find. Please use NSJSONSerialization instead. +- (BOOL)gtm_scanJSONObjectString:(NSString **)jsonString NS_DEPRECATED(10_0, 10_7, 2_0, 5_0, "Use NSJSONSerialization instead"); // Grabs the first JSON Array (array) that it finds and returns it // in jsonString. We don't parse the json, we just return the first valid JSON -// array we find. There are several other JSON parser packages that -// will actually parse the json for you. We recommend json-framework -// http://code.google.com/p/json-framework/ -- (BOOL)gtm_scanJSONArrayString:(NSString**)jsonString; +// array we find. Please use NSJSONSerialization instead. +- (BOOL)gtm_scanJSONArrayString:(NSString**)jsonString NS_DEPRECATED(10_0, 10_7, 2_0, 5_0, "Use NSJSONSerialization instead"); @end diff --git a/Foundation/GTMNSScanner+JSONTest.m b/Foundation/GTMNSScanner+JSONTest.m index d78f41d..d888574 100644 --- a/Foundation/GTMNSScanner+JSONTest.m +++ b/Foundation/GTMNSScanner+JSONTest.m @@ -19,6 +19,10 @@ #import "GTMSenTestCase.h" #import "GTMNSScanner+JSON.h" +#pragma clang diagnostic push +// Ignore all of the deprecation warnings for GTMNSScanner+JSON +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + @interface GTMNSScanner_JSONTest : GTMTestCase @end @@ -127,3 +131,5 @@ struct { } @end + +#pragma clang diagnostic pop -- cgit v1.2.3