Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

GREENHOUSE-541 replaced the usage of the third party YAJLIOS json par…

…sing library with native iOS 5 facilities
  • Loading branch information...
commit a7a744c5e8fe8294627f7384c68bae2862a9ea4a 1 parent 2c550ab
@royclarkson royclarkson authored
Showing with 106 additions and 1,573 deletions.
  1. +0 −1  Frameworks/YAJLIOS.framework/Headers
  2. +0 −1  Frameworks/YAJLIOS.framework/Resources
  3. +0 −62 Frameworks/YAJLIOS.framework/Versions/A/Headers/NSBundle+YAJL.h
  4. +0 −154 Frameworks/YAJLIOS.framework/Versions/A/Headers/NSObject+YAJL.h
  5. +0 −212 Frameworks/YAJLIOS.framework/Versions/A/Headers/YAJL.h
  6. +0 −196 Frameworks/YAJLIOS.framework/Versions/A/Headers/YAJLDocument.h
  7. +0 −171 Frameworks/YAJLIOS.framework/Versions/A/Headers/YAJLGen.h
  8. +0 −181 Frameworks/YAJLIOS.framework/Versions/A/Headers/YAJLParser.h
  9. +0 −85 Frameworks/YAJLIOS.framework/Versions/A/Headers/yajl_common.h
  10. +0 −159 Frameworks/YAJLIOS.framework/Versions/A/Headers/yajl_gen.h
  11. +0 −193 Frameworks/YAJLIOS.framework/Versions/A/Headers/yajl_parse.h
  12. +0 −23 Frameworks/YAJLIOS.framework/Versions/A/Headers/yajl_version.h
  13. +0 −18 Frameworks/YAJLIOS.framework/Versions/A/Resources/Info.plist
  14. BIN  Frameworks/YAJLIOS.framework/Versions/A/YAJLIOS
  15. +0 −1  Frameworks/YAJLIOS.framework/Versions/Current
  16. +0 −1  Frameworks/YAJLIOS.framework/YAJLIOS
  17. +0 −4 Greenhouse.xcodeproj/project.pbxproj
  18. +10 −7 Greenhouse/GHEventController.m
  19. +74 −61 Greenhouse/GHEventSessionController.m
  20. +0 −21 Greenhouse/GHInfoContent.html
  21. +10 −7 Greenhouse/GHProfileController.m
  22. +12 −12 Greenhouse/GHTwitterController.m
  23. +0 −3  Greenhouse/Greenhouse-Prefix.pch
View
1  Frameworks/YAJLIOS.framework/Headers
View
1  Frameworks/YAJLIOS.framework/Resources
View
62 Frameworks/YAJLIOS.framework/Versions/A/Headers/NSBundle+YAJL.h
@@ -1,62 +0,0 @@
-//
-// NSBundle+YAJL.h
-// YAJL
-//
-// Created by Gabriel Handford on 7/23/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "YAJLParser.h"
-
-/*!
- Utilities for loading JSON from resource bundles.
-
- @code
- id JSONValue = [[NSBundle mainBundle] yajl_JSONFromResource:@"kegs.json"];
- @endcode
- */
-@interface NSBundle(YAJL)
-
-/*!
- Load JSON from bundle.
- @param resource Resource name with extension, for example, file.json
- @throws YAJLParserException On parse error
- */
-- (id)yajl_JSONFromResource:(NSString *)resource;
-
-/*!
- Load JSON from bundle.
- @param resource Resource name with extension, for example, file.json
- @param options Parser options
- - YAJLParserOptionsNone: No options
- - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
- - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
-
- @param error Out error
- @result JSON value (NSArray, NSDictionary) or nil if errored
- */
-- (id)yajl_JSONFromResource:(NSString *)resource options:(YAJLParserOptions)options error:(NSError **)error;
-
-@end
View
154 Frameworks/YAJLIOS.framework/Versions/A/Headers/NSObject+YAJL.h
@@ -1,154 +0,0 @@
-//
-// NSObject+YAJL.h
-// YAJL
-//
-// Created by Gabriel Handford on 7/23/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "YAJLGen.h"
-#import "YAJLParser.h"
-
-/*!
- Generate JSON string from NSArray, NSDictionary or custom object or parse JSON from NSString or custom object.
-
- Parse JSON:
- @code
- NSData *JSONData = [NSData dataWithContentsOfFile:@"example.json"];
- NSArray *arrayFromData = [JSONData yajl_JSON];
-
- NSString *JSONString = @"[\"Test\"]";
- NSArray *arrayFromString = [JSONString yajl_JSON];
-
- // With options and out error
- NSError *error = nil;
- NSArray *arrayFromString = [JSONString yajl_JSONWithOptions:YAJLParserOptionsAllowComments error:&error];
- @endcode
-
- Generate JSON:
- @code
- NSDictionary *dict = [NSDictionary dictionaryWithObject:@"value" forKey:@"key"];
- NSString *JSONString = [dict yajl_JSONString];
-
- // Beautified with custon indent string
- NSArray *array = [NSArray arrayWithObjects:@"value1", @"value2", nil];
- NSString *JSONString = [dict yajl_JSONStringWithOptions:YAJLGenOptionsBeautify indentString:@" "];
- @endcode
- */
-@interface NSObject(YAJL)
-
-#pragma mark Gen
-
-/*!
- Create JSON string from object.
- Supported objects include: NSArray, NSDictionary, NSNumber, NSString, NSNull
- To override JSON value to encode (or support custom objects), implement (id)JSON; See YAJLCoding in YAJLGen.h
- @throws YAJLGenInvalidObjectException If object is invalid
- @result JSON String
- */
-- (NSString *)yajl_JSONString;
-
-/*!
- Create JSON string from object.
- Supported objects include: NSArray, NSDictionary, NSNumber, NSString, NSNull
- To override JSON value to encode (or support custom objects), implement (id)JSON; See YAJLCoding in YAJLGen.h
- @throws YAJLGenInvalidObjectException If object is invalid
- @param options
- - YAJLGenOptionsNone: No options
- - YAJLGenOptionsBeautify: Beautifiy JSON output
- - YAJLGenOptionsIgnoreUnknownTypes: Ignore unknown types (will use null value)
- - YAJLGenOptionsIncludeUnsupportedTypes: Handle non-JSON types (including NSDate, NSData, NSURL)
-
- @param indentString
- @result JSON String
- */
-- (NSString *)yajl_JSONStringWithOptions:(YAJLGenOptions)options indentString:(NSString *)indentString;
-
-
-#pragma mark Parsing
-
-/*!
- Parse JSON (NSString or NSData or dataUsingEncoding:).
- @result JSON object
- @throws YAJLParserException If a parse error occured
- @throws YAJLParsingUnsupportedException If not NSData or doesn't respond to dataUsingEncoding:
-
- @code
- NSString *JSONString = @"{'foo':['bar', true]}";
- id JSONValue = [JSONString yajl_JSON];
-
- NSData *JSONData = ...;
- id JSONValue = [JSONData yajl_JSON];
- @endcode
- */
-- (id)yajl_JSON;
-
-/*!
- Parse JSON (NSString or NSData or dataUsingEncoding:) with out error.
-
- If an error occurs, the returned object will be the current state of the object when
- the error occurred.
-
- @param error Error to set if we failed to parse
- @result JSON object
- @throws YAJLParserException If a parse error occured
- @throws YAJLParsingUnsupportedException If not NSData or doesn't respond to dataUsingEncoding:
-
- @code
- NSString *JSONString = @"{'foo':['bar', true]}";
- NSError *error = nil;
- [JSONString yajl_JSON:error];
- if (error) ...;
- @endcode
- */
-- (id)yajl_JSON:(NSError **)error;
-
-/*!
- Parse JSON (NSString or NSData or dataUsingEncoding:) with options and out error.
-
- If an error occurs, the returned object will be the current state of the object when
- the error occurred.
-
- @param options Parse options
- - YAJLParserOptionsNone: No options
- - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
- - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
-
- @param error Error to set if we failed to parse
- @result JSON object
- @throws YAJLParserException If a parse error occured
- @throws YAJLParsingUnsupportedException If not NSData or doesn't respond to dataUsingEncoding:
-
- @code
- NSString *JSONString = @"{'foo':['bar', true]} // comment";
- NSError *error = nil;
- [JSONString yajl_JSONWithOptions:YAJLParserOptionsAllowComments error:error];
- if (error) ...;
- @endcode
- */
-- (id)yajl_JSONWithOptions:(YAJLParserOptions)options error:(NSError **)error;
-
-@end
-
View
212 Frameworks/YAJLIOS.framework/Versions/A/Headers/YAJL.h
@@ -1,212 +0,0 @@
-//
-// YAJL.h
-// YAJL
-//
-// Created by Gabriel Handford on 7/23/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "YAJLParser.h"
-#import "YAJLDocument.h"
-#import "YAJLGen.h"
-#import "NSObject+YAJL.h"
-#import "NSBundle+YAJL.h"
-
-/*!
- @mainpage YAJL
-
- The YAJL framework is an Objective-C wrapper around the http://lloyd.github.com/yajl/ SAX-style JSON parser.
-
- @section Links
-
- Source: http://github.com/gabriel/yajl-objc
-
- View docs online: http://gabriel.github.com/yajl-objc/
-
- YAJL C docs: http://lloyd.github.com/yajl/
-
- @section Usage Usage
-
- To use the framework (for Mac OS X or iOS):
-
- @code
- // For Mac OS X
- #import <YAJL/YAJL.h>
- // For iOS
- #import <YAJLiOS/YAJL.h>
- @endcode
-
- @section Examples Examples
-
- @subsection Example1 To parse JSON from NSData
-
- @code
- NSData *JSONData = [NSData dataWithContentsOfFile:@"example.json"];
- NSArray *arrayFromData = [JSONData yajl_JSON];
- @endcode
-
- @subsection Example2 To parse JSON from NSString
-
- @code
- NSString *JSONString = @"[1, 2, 3]";
- NSArray *arrayFromString = [JSONString yajl_JSON];
- @endcode
-
- @subsection Example2 To parse JSON from NSString with error and comments
-
- @code
- // With options and out error
- NSString *JSONString = @"[1, 2, 3] // Allow comments";
- NSError *error = nil;
- NSArray *arrayFromString = [JSONString yajl_JSONWithOptions:YAJLParserOptionsAllowComments error:&error];
- @endcode
-
- @subsection Example3 To generate JSON from an object, NSArray, NSDictionary, etc.
-
- @code
- NSDictionary *dict = [NSDictionary dictionaryWithObject:@"value" forKey:@"key"];
- NSString *JSONString = [dict yajl_JSONString];
- @endcode
-
- @subsection Example4 To generate JSON from an object, beautified with custom indent
-
- @code
- // Beautified with custon indent string
- NSArray *array = [NSArray arrayWithObjects:@"value1", @"value2", nil];
- NSString *JSONString = [dict yajl_JSONStringWithOptions:YAJLGenOptionsBeautify indentString:@" "];
- @endcode
-
- @subsection Example5 To use the streaming (or SAX style) parser, use YAJLParser
-
- @code
- NSData *data = [NSData dataWithContentsOfFile:@"example.json"];
-
- YAJLParser *parser = [[YAJLParser alloc] initWithParserOptions:YAJLParserOptionsAllowComments];
- parser.delegate = self;
- [parser parse:data];
- if (parser.parserError)
- NSLog(@"Error:\n%@", parser.parserError);
-
- parser.delegate = nil;
- [parser release];
-
- // Include delegate methods from YAJLParserDelegate
- - (void)parserDidStartDictionary:(YAJLParser *)parser { }
- - (void)parserDidEndDictionary:(YAJLParser *)parser { }
-
- - (void)parserDidStartArray:(YAJLParser *)parser { }
- - (void)parserDidEndArray:(YAJLParser *)parser { }
-
- - (void)parser:(YAJLParser *)parser didMapKey:(NSString *)key { }
- - (void)parser:(YAJLParser *)parser didAdd:(id)value { }
- @endcode
-
- @subsection ParserOptions Parser Options
-
- There are options when parsing that can be specified with YAJLParser#initWithParserOptions:.
-
- - YAJLParserOptionsAllowComments: Allows comments in JSON
- - YAJLParserOptionsCheckUTF8: Will verify UTF-8
- - YAJLParserOptionsStrictPrecision: Will force strict precision and return integer overflow error, if number is greater than long long.
-
- @subsection Example6 Parsing as data becomes available
-
- @code
- YAJLParser *parser = [[[YAJLParser alloc] init] autorelease];
- parser.delegate = self;
-
- // A chunk of data comes...
- YAJLParserStatus status = [parser parse:chunk1];
- // 'status' should be YAJLParserStatusInsufficientData, if its not finished
- if (parser.parserError)
- NSLog(@"Error:\n%@", parser.parserError);
-
- // Another chunk of data comes...
- YAJLParserStatus status = [parser parse:chunk2];
- // 'status' should be YAJLParserStatusOK if its finished
- if (parser.parserError)
- NSLog(@"Error:\n%@", parser.parserError);
- @endcode
-
- @subsection Example7 Document style parsing
-
- To use the document style, use YAJLDocument. Usage should be very similar to NSXMLDocument.
-
- @code
- NSData *data = [NSData dataWithContentsOfFile:@"example.json"];
- NSError *error = nil;
- YAJLDocument *document = [[YAJLDocument alloc] initWithData:data parserOptions:YAJLParserOptionsNone error:&error];
- // Access root element at document.root
- NSLog(@"Root: %@", document.root);
- [document release];
- @endcode
-
- @subsection Example8 Document style parsing as data becomes available
-
- @code
- YAJLDocument *document = [[YAJLDocument alloc] init];
- document.delegate = self;
-
- NSError *error = nil;
- [document parse:chunk1 error:error];
- [document parse:chunk2 error:error];
-
- // You can access root element at document.root
- NSLog(@"Root: %@", document.root);
- [document release];
-
- // Or via the YAJLDocumentDelegate delegate methods
-
- - (void)document:(YAJLDocument *)document didAddDictionary:(NSDictionary *)dict { }
- - (void)document:(YAJLDocument *)document didAddArray:(NSArray *)array { }
- - (void)document:(YAJLDocument *)document didAddObject:(id)object toArray:(NSArray *)array { }
- - (void)document:(YAJLDocument *)document didSetObject:(id)object forKey:(id)key inDictionary:(NSDictionary *)dict { }
- @endcode
-
- @subsection Example9 Load JSON from Bundle
-
- @code
- id JSONValue = [[NSBundle mainBundle] yajl_JSONFromResource:@"kegs.json"];
- @endcode
-
- @section CustomizedEncoding Customized Encoding
-
- To implement JSON encodable value for custom objects or override for existing objects, implement <tt>- (id)JSON;</tt>
-
- For example:
-
- @code
- @interface CustomObject : NSObject
- @end
-
- @implementation CustomObject
-
- - (id)JSON {
- return [NSArray arrayWithObject:[NSNumber numberWithInteger:1]];
- }
-
- @end
- @endcode
-
- */
View
196 Frameworks/YAJLIOS.framework/Versions/A/Headers/YAJLDocument.h
@@ -1,196 +0,0 @@
-//
-// YAJLDecoder.h
-// YAJL
-//
-// Created by Gabriel Handford on 3/1/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-#include "YAJLParser.h"
-
-typedef enum {
- YAJLDecoderCurrentTypeNone,
- YAJLDecoderCurrentTypeArray,
- YAJLDecoderCurrentTypeDict
-} YAJLDecoderCurrentType;
-
-extern NSInteger YAJLDocumentStackCapacity;
-
-@class YAJLDocument;
-
-/*!
- YAJLDocument delegate notified when objects are added.
- */
-@protocol YAJLDocumentDelegate <NSObject>
-@optional
-/*!
- Did add dictionary.
- @param document Sender
- @param dict Dictionary that was added
- */
-- (void)document:(YAJLDocument *)document didAddDictionary:(NSDictionary *)dict;
-
-/*!
- Did add array.
- @param document Sender
- @param array Array that was added
- */
-- (void)document:(YAJLDocument *)document didAddArray:(NSArray *)array;
-
-/*!
- Did add object to array.
- @param document Sender
- @param object Object added
- @param array Array objct was added to
- */
-- (void)document:(YAJLDocument *)document didAddObject:(id)object toArray:(NSArray *)array;
-
-/*!
- Did set object for key on dictionary.
- @param document Sender
- @param object Object that was set
- @param key Key
- @param dict Dictionary object was set for key on
- */
-- (void)document:(YAJLDocument *)document didSetObject:(id)object forKey:(id)key inDictionary:(NSDictionary *)dict;
-@end
-
-/*!
- JSON document interface.
-
- @code
- NSData *data = [NSData dataWithContentsOfFile:@"example.json"];
- NSError *error = nil;
- YAJLDocument *document = [[YAJLDocument alloc] initWithData:data parserOptions:YAJLParserOptionsNone error:&error];
- // Access root element at document.root
- NSLog(@"Root: %@", document.root);
- [document release];
- @endcode
-
- Example for streaming:
- @code
- YAJLDocument *document = [[YAJLDocument alloc] init];
- document.delegate = self;
-
- NSError *error = nil;
- [document parse:chunk1 error:error];
- [document parse:chunk2 error:error];
-
- // You can access root element at document.root
- NSLog(@"Root: %@", document.root);
- [document release];
-
- // Or via the YAJLDocumentDelegate delegate methods
-
- - (void)document:(YAJLDocument *)document didAddDictionary:(NSDictionary *)dict { }
- - (void)document:(YAJLDocument *)document didAddArray:(NSArray *)array { }
- - (void)document:(YAJLDocument *)document didAddObject:(id)object toArray:(NSArray *)array { }
- - (void)document:(YAJLDocument *)document didSetObject:(id)object forKey:(id)key inDictionary:(NSDictionary *)dict { }
- @endcode
- */
-@interface YAJLDocument : NSObject <YAJLParserDelegate> {
-
- id root_; // NSArray or NSDictionary
- YAJLParser *parser_;
-
- // TODO(gabe): This should be __weak
- id<YAJLDocumentDelegate> delegate_;
-
- __weak NSMutableDictionary *dict_; // weak; if map in progress, points to the current map
- __weak NSMutableArray *array_; // weak; If array in progress, points the current array
- __weak NSString *key_; // weak; If map in progress, points to current key
-
- NSMutableArray *stack_;
- NSMutableArray *keyStack_;
-
- YAJLDecoderCurrentType currentType_;
-
- YAJLParserStatus parserStatus_;
-
-}
-
-@property (readonly, nonatomic) id root; //! The root element of the document, either NSArray or NSDictionary
-@property (readonly, nonatomic) YAJLParserStatus parserStatus; //! The current status of parsing
-@property (assign, nonatomic) id<YAJLDocumentDelegate> delegate; //! Delegate
-
-/*!
- Create document from data.
- @param data Data to parse
- @param parserOptions Parse options
- - YAJLParserOptionsNone: No options
- - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
- - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
- @param error Error to set on failure
- */
-- (id)initWithData:(NSData *)data parserOptions:(YAJLParserOptions)parserOptions error:(NSError **)error;
-
-/*!
- Create document from data.
- @param data Data to parse
- @param parserOptions Parse options
- - YAJLParserOptionsNone: No options
- - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
- - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
- @param capacity Initial capacity for NSArray and NSDictionary objects (Defaults to 20)
- @param error Error to set on failure
- */
-- (id)initWithData:(NSData *)data parserOptions:(YAJLParserOptions)parserOptions capacity:(NSInteger)capacity error:(NSError **)error;
-
-/*!
- Create empty document with parser options.
- @param parserOptions Parse options
- - YAJLParserOptionsNone: No options
- - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
- - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
- */
-- (id)initWithParserOptions:(YAJLParserOptions)parserOptions;
-
-/*!
- Create empty document with parser options.
- @param parserOptions Parse options
- - YAJLParserOptionsNone: No options
- - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
- - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
- @param capacity Initial capacity for NSArray and NSDictionary objects (Defaults to 20)
- */
-- (id)initWithParserOptions:(YAJLParserOptions)parserOptions capacity:(NSInteger)capacity;
-
-/*!
- Parse data.
- @param data Data to parse
- @param error Out error to set on failure
- @result Parser status
- - YAJLParserStatusNone: No status
- - YAJLParserStatusOK: Parsed OK
- - YAJLParserStatusInsufficientData: There was insufficient data
- - YAJLParserStatusError: Parser errored
- */
-- (YAJLParserStatus)parse:(NSData *)data error:(NSError **)error;
-
-@end
View
171 Frameworks/YAJLIOS.framework/Versions/A/Headers/YAJLGen.h
@@ -1,171 +0,0 @@
-//
-// YAJLGen.h
-// YAJL
-//
-// Created by Gabriel Handford on 7/19/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#include "yajl_gen.h"
-
-
-extern NSString *const YAJLGenInvalidObjectException; //! Exception type if we encounter invalid object
-
-//! JSON generate options
-enum YAJLGenOptions {
- YAJLGenOptionsNone = 0, //!< No options
- YAJLGenOptionsBeautify = 1 << 0, //!< Beautifiy JSON output
- YAJLGenOptionsIgnoreUnknownTypes = 1 << 1, //!< Ignore unknown types (will use null value)
- YAJLGenOptionsIncludeUnsupportedTypes = 1 << 2, //!< Handle non-JSON types (including NSDate, NSData, NSURL)
-};
-typedef NSUInteger YAJLGenOptions;
-
-/*!
- YAJL JSON string generator.
- Supports the following types:
- - NSArray
- - NSDictionary
- - NSString
- - NSNumber
- - NSNull
-
- We also support the following types (if using YAJLGenOptionsIncludeUnsupportedTypes option),
- by converting to JSON supported types:
- - NSDate: number representing number of milliseconds since (1970) epoch
- - NSData: Base64 encoded string
- - NSURL: URL (absolute) string
- */
-@interface YAJLGen : NSObject {
- yajl_gen gen_;
-
- YAJLGenOptions genOptions_;
-}
-
-/*!
- JSON generator with options.
- @param genOptions Generate options
- - YAJLGenOptionsNone: No options
- - YAJLGenOptionsBeautify: Beautifiy JSON output
- - YAJLGenOptionsIgnoreUnknownTypes: Ignore unknown types (will use null value)
- - YAJLGenOptionsIncludeUnsupportedTypes: Handle non-JSON types (including NSDate, NSData, NSURL)
-
- @param indentString String for indentation
- */
-- (id)initWithGenOptions:(YAJLGenOptions)genOptions indentString:(NSString *)indentString;
-
-/*!
- Write JSON for object to buffer.
- @param obj Supported or custom object
- */
-- (void)object:(id)obj;
-
-/*!
- Write null value to buffer.
- */
-- (void)null;
-
-/*!
- Write bool value to buffer.
- @param b Output true or false
- */
-- (void)bool:(BOOL)b;
-
-/*!
- Write numeric value to buffer.
- @param number Numeric value
- */
-- (void)number:(NSNumber *)number;
-
-/*!
- Write string value to buffer.
- @param s String value
- */
-- (void)string:(NSString *)s;
-
-/*!
- Write dictionary start ('{') to buffer.
- */
-- (void)startDictionary;
-
-/*!
- Write dictionary end ('}') to buffer.
- */
-- (void)endDictionary;
-
-/*!
- Write array start ('[') to buffer.
- */
-- (void)startArray;
-
-/*!
- Write array end (']') to buffer.
- */
-- (void)endArray;
-
-/*!
- Clear JSON buffer.
- */
-- (void)clear;
-
-/*!
- Get current JSON buffer.
- */
-- (NSString *)buffer;
-
-@end
-
-
-/*!
- Custom objects can support manual JSON encoding.
-
- @code
- @interface CustomObject : NSObject
- @end
-
- @implementation CustomObject
-
- - (id)JSON {
- return [NSArray arrayWithObject:[NSNumber numberWithInteger:1]];
- }
-
- @end
- @endcode
-
- And then:
-
- @code
- CustomObject *customObject = [[CustomObject alloc] init];
- NSString *JSONString = [customObject yajl_JSON];
- // JSONString == "[1]";
- @endcode
- */
-@protocol YAJLCoding <NSObject>
-
-/*!
- Provide custom and/or encodable object to parse to JSON string.
- @result Object encodable as JSON such as NSDictionary, NSArray, etc
- */
-- (id)JSON;
-
-@end
View
181 Frameworks/YAJLIOS.framework/Versions/A/Headers/YAJLParser.h
@@ -1,181 +0,0 @@
-//
-// YAJLParser.h
-// YAJL
-//
-// Created by Gabriel Handford on 6/14/09.
-// Copyright 2009. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-// OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-#include "yajl_parse.h"
-
-
-extern NSString *const YAJLErrorDomain; //! Error domain for YAJL
-extern NSString *const YAJLParserException; //! Generic parse exception
-extern NSString *const YAJLParsingUnsupportedException; //! Parsing unsupported exception
-
-extern NSString *const YAJLParserValueKey; //! Key in NSError userInfo for value we errored on
-
-//! Parser error codes
-enum YAJLParserErrorCode {
- YAJLParserErrorCodeAllocError = -1000, //!< Alloc error
- YAJLParserErrorCodeDoubleOverflow = -1001, //!< Double overflow
- YAJLParserErrorCodeIntegerOverflow = -1002 //!< Integer overflow
-};
-typedef NSInteger YAJLParserErrorCode; //! Parser error codes
-
-//! Parser options
-enum YAJLParserOptions {
- YAJLParserOptionsNone = 0, //!< No options
- YAJLParserOptionsAllowComments = 1 << 0, //!< Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
- YAJLParserOptionsCheckUTF8 = 1 << 1, //!< Invalid UTF8 strings will cause a parse error
- YAJLParserOptionsStrictPrecision = 1 << 2, //!< If YES will force strict precision and return integer overflow error
-};
-typedef NSUInteger YAJLParserOptions; //! Parser options
-
-//! Parser status
-enum {
- YAJLParserStatusNone = 0, //!< No status
- YAJLParserStatusOK = 1, //!< Parsed OK
- YAJLParserStatusInsufficientData = 2, //!< There was insufficient data
- YAJLParserStatusError = 3 //!< Parser errored
-};
-typedef NSUInteger YAJLParserStatus; //!< Status of the last parse event
-
-
-@class YAJLParser;
-
-/*!
- Delegate for YAJL JSON parser.
- */
-@protocol YAJLParserDelegate <NSObject>
-
-/*!
- Parser did start dictionary.
- @param parser Sender
- */
-- (void)parserDidStartDictionary:(YAJLParser *)parser;
-
-/*!
- Parser did end dictionary.
- @param parser Sender
- */
-- (void)parserDidEndDictionary:(YAJLParser *)parser;
-
-/*!
- Parser did start array.
- @param parser Sender
- */
-- (void)parserDidStartArray:(YAJLParser *)parser;
-
-/*!
- Parser did end array.
- @param parser Sender
- */
-- (void)parserDidEndArray:(YAJLParser *)parser;
-
-/*!
- Parser did map key.
- @param parser Sender
- @param key Key that was mapped
- */
-- (void)parser:(YAJLParser *)parser didMapKey:(NSString *)key;
-
-/*!
- Did add value.
- @param parser Sender
- @param value Value of type NSNull, NSString or NSNumber
- */
-- (void)parser:(YAJLParser *)parser didAdd:(id)value;
-
-@end
-
-/*!
- JSON parser.
-
- @code
- NSData *data = [NSData dataWithContentsOfFile:@"example.json"];
-
- YAJLParser *parser = [[YAJLParser alloc] initWithParserOptions:YAJLParserOptionsAllowComments];
- parser.delegate = self;
- [parser parse:data];
- if (parser.parserError) {
- NSLog(@"Error:\n%@", parser.parserError);
- }
-
- parser.delegate = nil;
- [parser release];
-
- // Include delegate methods from YAJLParserDelegate
- - (void)parserDidStartDictionary:(YAJLParser *)parser { }
- - (void)parserDidEndDictionary:(YAJLParser *)parser { }
-
- - (void)parserDidStartArray:(YAJLParser *)parser { }
- - (void)parserDidEndArray:(YAJLParser *)parser { }
-
- - (void)parser:(YAJLParser *)parser didMapKey:(NSString *)key { }
- - (void)parser:(YAJLParser *)parser didAdd:(id)value { }
- @endcode
- */
-@interface YAJLParser : NSObject {
-
- yajl_handle handle_;
-
- id <YAJLParserDelegate> delegate_; // weak
-
- YAJLParserOptions parserOptions_;
-
- NSError *parserError_;
-}
-
-@property (assign, nonatomic) id <YAJLParserDelegate> delegate;
-@property (readonly, retain, nonatomic) NSError *parserError;
-@property (readonly, nonatomic) YAJLParserOptions parserOptions;
-
-/*!
- Create parser with data and options.
- @param parserOptions Parser options
- - YAJLParserOptionsNone: No options
- - YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both /&asterisk; &asterisk;/ and //)
- - YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- - YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
- */
-- (id)initWithParserOptions:(YAJLParserOptions)parserOptions;
-
-/*!
- Parse data.
-
- If streaming, you can call parse multiple times as long as
- previous calls return YAJLParserStatusInsufficientData.
-
- @param data
- @result Parser status
- - YAJLParserStatusNone: No status
- - YAJLParserStatusOK: Parsed OK
- - YAJLParserStatusInsufficientData: There was insufficient data
- - YAJLParserStatusError: Parser errored
- */
-- (YAJLParserStatus)parse:(NSData *)data;
-
-@end
View
85 Frameworks/YAJLIOS.framework/Versions/A/Headers/yajl_common.h
@@ -1,85 +0,0 @@
-/*
- * Copyright 2010, Lloyd Hilaiel.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. Neither the name of Lloyd Hilaiel nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef __YAJL_COMMON_H__
-#define __YAJL_COMMON_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define YAJL_MAX_DEPTH 128
-
-/* msft dll export gunk. To build a DLL on windows, you
- * must define WIN32, YAJL_SHARED, and YAJL_BUILD. To use a shared
- * DLL, you must define YAJL_SHARED and WIN32 */
-#if defined(WIN32) && defined(YAJL_SHARED)
-# ifdef YAJL_BUILD
-# define YAJL_API __declspec(dllexport)
-# else
-# define YAJL_API __declspec(dllimport)
-# endif
-#else
-# define YAJL_API
-#endif
-
-/** pointer to a malloc function, supporting client overriding memory
- * allocation routines */
-typedef void * (*yajl_malloc_func)(void *ctx, unsigned int sz);
-
-/** pointer to a free function, supporting client overriding memory
- * allocation routines */
-typedef void (*yajl_free_func)(void *ctx, void * ptr);
-
-/** pointer to a realloc function which can resize an allocation. */
-typedef void * (*yajl_realloc_func)(void *ctx, void * ptr, unsigned int sz);
-
-/** A structure which can be passed to yajl_*_alloc routines to allow the
- * client to specify memory allocation functions to be used. */
-typedef struct
-{
- /** pointer to a function that can allocate uninitialized memory */
- yajl_malloc_func malloc;
- /** pointer to a function that can resize memory allocations */
- yajl_realloc_func realloc;
- /** pointer to a function that can free memory allocated using
- * reallocFunction or mallocFunction */
- yajl_free_func free;
- /** a context pointer that will be passed to above allocation routines */
- void * ctx;
-} yajl_alloc_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
View
159 Frameworks/YAJLIOS.framework/Versions/A/Headers/yajl_gen.h
@@ -1,159 +0,0 @@
-/*
- * Copyright 2010, Lloyd Hilaiel.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. Neither the name of Lloyd Hilaiel nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * \file yajl_gen.h
- * Interface to YAJL's JSON generation facilities.
- */
-
-#include "yajl_common.h"
-
-#ifndef __YAJL_GEN_H__
-#define __YAJL_GEN_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
- /** generator status codes */
- typedef enum {
- /** no error */
- yajl_gen_status_ok = 0,
- /** at a point where a map key is generated, a function other than
- * yajl_gen_string was called */
- yajl_gen_keys_must_be_strings,
- /** YAJL's maximum generation depth was exceeded. see
- * YAJL_MAX_DEPTH */
- yajl_max_depth_exceeded,
- /** A generator function (yajl_gen_XXX) was called while in an error
- * state */
- yajl_gen_in_error_state,
- /** A complete JSON document has been generated */
- yajl_gen_generation_complete,
- /** yajl_gen_double was passed an invalid floating point value
- * (infinity or NaN). */
- yajl_gen_invalid_number,
- /** A print callback was passed in, so there is no internal
- * buffer to get from */
- yajl_gen_no_buf
- } yajl_gen_status;
-
- /** an opaque handle to a generator */
- typedef struct yajl_gen_t * yajl_gen;
-
- /** a callback used for "printing" the results. */
- typedef void (*yajl_print_t)(void * ctx,
- const char * str,
- unsigned int len);
-
- /** configuration structure for the generator */
- typedef struct {
- /** generate indented (beautiful) output */
- unsigned int beautify;
- /** an opportunity to define an indent string. such as \\t or
- * some number of spaces. default is four spaces ' '. This
- * member is only relevant when beautify is true */
- const char * indentString;
- } yajl_gen_config;
-
- /** allocate a generator handle
- * \param config a pointer to a structure containing parameters which
- * configure the behavior of the json generator
- * \param allocFuncs an optional pointer to a structure which allows
- * the client to overide the memory allocation
- * used by yajl. May be NULL, in which case
- * malloc/free/realloc will be used.
- *
- * \returns an allocated handle on success, NULL on failure (bad params)
- */
- YAJL_API yajl_gen yajl_gen_alloc(const yajl_gen_config * config,
- const yajl_alloc_funcs * allocFuncs);
-
- /** allocate a generator handle that will print to the specified
- * callback rather than storing the results in an internal buffer.
- * \param callback a pointer to a printer function. May be NULL
- * in which case, the results will be store in an
- * internal buffer.
- * \param config a pointer to a structure containing parameters
- * which configure the behavior of the json
- * generator.
- * \param allocFuncs an optional pointer to a structure which allows
- * the client to overide the memory allocation
- * used by yajl. May be NULL, in which case
- * malloc/free/realloc will be used.
- * \param ctx a context pointer that will be passed to the
- * printer callback.
- *
- * \returns an allocated handle on success, NULL on failure (bad params)
- */
- YAJL_API yajl_gen yajl_gen_alloc2(const yajl_print_t callback,
- const yajl_gen_config * config,
- const yajl_alloc_funcs * allocFuncs,
- void * ctx);
-
- /** free a generator handle */
- YAJL_API void yajl_gen_free(yajl_gen handle);
-
- YAJL_API yajl_gen_status yajl_gen_integer(yajl_gen hand, long int number);
- /** generate a floating point number. number may not be infinity or
- * NaN, as these have no representation in JSON. In these cases the
- * generator will return 'yajl_gen_invalid_number' */
- YAJL_API yajl_gen_status yajl_gen_double(yajl_gen hand, double number);
- YAJL_API yajl_gen_status yajl_gen_number(yajl_gen hand,
- const char * num,
- unsigned int len);
- YAJL_API yajl_gen_status yajl_gen_string(yajl_gen hand,
- const unsigned char * str,
- unsigned int len);
- YAJL_API yajl_gen_status yajl_gen_null(yajl_gen hand);
- YAJL_API yajl_gen_status yajl_gen_bool(yajl_gen hand, int boolean);
- YAJL_API yajl_gen_status yajl_gen_map_open(yajl_gen hand);
- YAJL_API yajl_gen_status yajl_gen_map_close(yajl_gen hand);
- YAJL_API yajl_gen_status yajl_gen_array_open(yajl_gen hand);
- YAJL_API yajl_gen_status yajl_gen_array_close(yajl_gen hand);
-
- /** access the null terminated generator buffer. If incrementally
- * outputing JSON, one should call yajl_gen_clear to clear the
- * buffer. This allows stream generation. */
- YAJL_API yajl_gen_status yajl_gen_get_buf(yajl_gen hand,
- const unsigned char ** buf,
- unsigned int * len);
-
- /** clear yajl's output buffer, but maintain all internal generation
- * state. This function will not "reset" the generator state, and is
- * intended to enable incremental JSON outputing. */
- YAJL_API void yajl_gen_clear(yajl_gen hand);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
View
193 Frameworks/YAJLIOS.framework/Versions/A/Headers/yajl_parse.h
@@ -1,193 +0,0 @@
-/*
- * Copyright 2010, Lloyd Hilaiel.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. Neither the name of Lloyd Hilaiel nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * \file yajl_parse.h
- * Interface to YAJL's JSON parsing facilities.
- */
-
-#include "yajl_common.h"
-
-#ifndef __YAJL_PARSE_H__
-#define __YAJL_PARSE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
- /** error codes returned from this interface */
- typedef enum {
- /** no error was encountered */
- yajl_status_ok,
- /** a client callback returned zero, stopping the parse */
- yajl_status_client_canceled,
- /** The parse cannot yet complete because more json input text
- * is required, call yajl_parse with the next buffer of input text.
- * (pertinent only when stream parsing) */
- yajl_status_insufficient_data,
- /** An error occured during the parse. Call yajl_get_error for
- * more information about the encountered error */
- yajl_status_error
- } yajl_status;
-
- /** attain a human readable, english, string for an error */
- YAJL_API const char * yajl_status_to_string(yajl_status code);
-
- /** an opaque handle to a parser */
- typedef struct yajl_handle_t * yajl_handle;
-
- /** yajl is an event driven parser. this means as json elements are
- * parsed, you are called back to do something with the data. The
- * functions in this table indicate the various events for which
- * you will be called back. Each callback accepts a "context"
- * pointer, this is a void * that is passed into the yajl_parse
- * function which the client code may use to pass around context.
- *
- * All callbacks return an integer. If non-zero, the parse will
- * continue. If zero, the parse will be canceled and
- * yajl_status_client_canceled will be returned from the parse.
- *
- * Note about handling of numbers:
- * yajl will only convert numbers that can be represented in a double
- * or a long int. All other numbers will be passed to the client
- * in string form using the yajl_number callback. Furthermore, if
- * yajl_number is not NULL, it will always be used to return numbers,
- * that is yajl_integer and yajl_double will be ignored. If
- * yajl_number is NULL but one of yajl_integer or yajl_double are
- * defined, parsing of a number larger than is representable
- * in a double or long int will result in a parse error.
- */
- typedef struct {
- int (* yajl_null)(void * ctx);
- int (* yajl_boolean)(void * ctx, int boolVal);
- int (* yajl_integer)(void * ctx, long integerVal);
- int (* yajl_double)(void * ctx, double doubleVal);
- /** A callback which passes the string representation of the number
- * back to the client. Will be used for all numbers when present */
- int (* yajl_number)(void * ctx, const char * numberVal,
- unsigned int numberLen);
-
- /** strings are returned as pointers into the JSON text when,
- * possible, as a result, they are _not_ null padded */
- int (* yajl_string)(void * ctx, const unsigned char * stringVal,
- unsigned int stringLen);
-
- int (* yajl_start_map)(void * ctx);
- int (* yajl_map_key)(void * ctx, const unsigned char * key,
- unsigned int stringLen);
- int (* yajl_end_map)(void * ctx);
-
- int (* yajl_start_array)(void * ctx);
- int (* yajl_end_array)(void * ctx);
- } yajl_callbacks;
-
- /** configuration structure for the generator */
- typedef struct {
- /** if nonzero, javascript style comments will be allowed in
- * the json input, both slash star and slash slash */
- unsigned int allowComments;
- /** if nonzero, invalid UTF8 strings will cause a parse
- * error */
- unsigned int checkUTF8;
- } yajl_parser_config;
-
- /** allocate a parser handle
- * \param callbacks a yajl callbacks structure specifying the
- * functions to call when different JSON entities
- * are encountered in the input text. May be NULL,
- * which is only useful for validation.
- * \param config configuration parameters for the parse.
- * \param ctx a context pointer that will be passed to callbacks.
- */
- YAJL_API yajl_handle yajl_alloc(const yajl_callbacks * callbacks,
- const yajl_parser_config * config,
- const yajl_alloc_funcs * allocFuncs,
- void * ctx);
-
- /** free a parser handle */
- YAJL_API void yajl_free(yajl_handle handle);
-
- /** Parse some json!
- * \param hand - a handle to the json parser allocated with yajl_alloc
- * \param jsonText - a pointer to the UTF8 json text to be parsed
- * \param jsonTextLength - the length, in bytes, of input text
- */
- YAJL_API yajl_status yajl_parse(yajl_handle hand,
- const unsigned char * jsonText,
- unsigned int jsonTextLength);
-
- /** Parse any remaining buffered json.
- * Since yajl is a stream-based parser, without an explicit end of
- * input, yajl sometimes can't decide if content at the end of the
- * stream is valid or not. For example, if "1" has been fed in,
- * yajl can't know whether another digit is next or some character
- * that would terminate the integer token.
- *
- * \param hand - a handle to the json parser allocated with yajl_alloc
- */
- YAJL_API yajl_status yajl_parse_complete(yajl_handle hand);
-
- /** get an error string describing the state of the
- * parse.
- *
- * If verbose is non-zero, the message will include the JSON
- * text where the error occured, along with an arrow pointing to
- * the specific char.
- *
- * \returns A dynamically allocated string will be returned which should
- * be freed with yajl_free_error
- */
- YAJL_API unsigned char * yajl_get_error(yajl_handle hand, int verbose,
- const unsigned char * jsonText,
- unsigned int jsonTextLength);
-
- /**
- * get the amount of data consumed from the last chunk passed to YAJL.
- *
- * In the case of a successful parse this can help you understand if
- * the entire buffer was consumed (which will allow you to handle
- * "junk at end of input".
- *
- * In the event an error is encountered during parsing, this function
- * affords the client a way to get the offset into the most recent
- * chunk where the error occured. 0 will be returned if no error
- * was encountered.
- */
- YAJL_API unsigned int yajl_get_bytes_consumed(yajl_handle hand);
-
- /** free an error returned from yajl_get_error */
- YAJL_API void yajl_free_error(yajl_handle hand, unsigned char * str);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
View
23 Frameworks/YAJLIOS.framework/Versions/A/Headers/yajl_version.h
@@ -1,23 +0,0 @@
-#ifndef YAJL_VERSION_H_
-#define YAJL_VERSION_H_
-
-#include "yajl_common.h"
-
-#define YAJL_MAJOR 1
-#define YAJL_MINOR 0
-#define YAJL_MICRO 11
-
-#define YAJL_VERSION ((YAJL_MAJOR * 10000) + (YAJL_MINOR * 100) + YAJL_MICRO)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int YAJL_API yajl_version(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* YAJL_VERSION_H_ */
-
View
18 Frameworks/YAJLIOS.framework/Versions/A/Resources/Info.plist
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleIdentifier</key>
- <string>me.rel.yajl</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>$(YAJL_VERSION)</string>
-</dict>
-</plist>
View
BIN  Frameworks/YAJLIOS.framework/Versions/A/YAJLIOS
Binary file not shown
View
1  Frameworks/YAJLIOS.framework/Versions/Current
View
1  Frameworks/YAJLIOS.framework/YAJLIOS
View
4 Greenhouse.xcodeproj/project.pbxproj
@@ -158,7 +158,6 @@
81E42E8115ADE82F001FA72D /* GHVenueDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 81E42E1515ADE82F001FA72D /* GHVenueDetailsViewController.m */; };
81E42E8215ADE82F001FA72D /* GHVenueRoom.m in Sources */ = {isa = PBXBuildFile; fileRef = 81E42E1715ADE82F001FA72D /* GHVenueRoom.m */; };
81E42E8315ADE82F001FA72D /* GHWebImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 81E42E1A15ADE82F001FA72D /* GHWebImageView.m */; };
- 81E42EBE15AE13D4001FA72D /* YAJLIOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81E42EBD15AE13D4001FA72D /* YAJLIOS.framework */; };
81E75F3A11BE0D5800E6B283 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81E75F3911BE0D5800E6B283 /* Security.framework */; };
81F8DEC01227801000C3E8FD /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81F8DEBF1227801000C3E8FD /* QuartzCore.framework */; };
/* End PBXBuildFile section */
@@ -397,7 +396,6 @@
81E42E1815ADE82F001FA72D /* GHInitializingModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GHInitializingModel.h; sourceTree = "<group>"; };
81E42E1915ADE82F001FA72D /* GHWebImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GHWebImageView.h; sourceTree = "<group>"; };
81E42E1A15ADE82F001FA72D /* GHWebImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHWebImageView.m; sourceTree = "<group>"; };
- 81E42EBD15AE13D4001FA72D /* YAJLIOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YAJLIOS.framework; path = Frameworks/YAJLIOS.framework; sourceTree = "<group>"; };
81E75F3911BE0D5800E6B283 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
81F8DEBF1227801000C3E8FD /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -414,7 +412,6 @@
819E443C11FF1FA600DBC0BB /* MapKit.framework in Frameworks */,
811BA5D0120C58E40045BB34 /* CoreLocation.framework in Frameworks */,
81F8DEC01227801000C3E8FD /* QuartzCore.framework in Frameworks */,
- 81E42EBE15AE13D4001FA72D /* YAJLIOS.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -468,7 +465,6 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
- 81E42EBD15AE13D4001FA72D /* YAJLIOS.framework */,
28860BE40F44EE6400985440 /* CoreData.framework */,
2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */,
811BA5CF120C58E40045BB34 /* CoreLocation.framework */,
View
17 Greenhouse/GHEventController.m
@@ -61,16 +61,19 @@ - (void)fetchEvents
- (void)fetchEventsDidFinishWithData:(NSData *)data
{
- NSString *responseBody = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- DLog(@"%@", responseBody);
+ DLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
- NSMutableArray *events = [[NSMutableArray alloc] init];
- NSArray *jsonArray = [responseBody yajl_JSON];
+ NSError *error;
+ NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
DLog(@"%@", jsonArray);
- [jsonArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
- [events addObject:[[GHEvent alloc] initWithDictionary:obj]];
- }];
+ NSMutableArray *events = [[NSMutableArray alloc] init];
+ if (!error)
+ {
+ [jsonArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ [events addObject:[[GHEvent alloc] initWithDictionary:obj]];
+ }];
+ }
if ([delegate respondsToSelector:@selector(fetchEventsDidFinishWithResults:)])
{
View
135 Greenhouse/GHEventSessionController.m
@@ -77,42 +77,46 @@ - (void)fetchCurrentSessionsByEventId:(NSString *)eventId;
- (void)fetchCurrentSessionsDidFinishWithData:(NSData *)data
{
- NSString *responseBody = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- DLog(@"%@", responseBody);
+ DLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
NSMutableArray *arrayCurrentSessions = [[NSMutableArray alloc] init];
NSMutableArray *arrayUpcomingSessions = [[NSMutableArray alloc] init];
- NSArray *jsonArray = [responseBody yajl_JSON];
- DLog(@"%@", jsonArray);
+ NSError *error;
+ NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
- NSDate *nextStartTime = nil;
- NSDate *now = [NSDate date];
- DLog(@"%@", now.description);
-
- for (NSDictionary *d in jsonArray)
+ if (!error)
{
- GHEventSession *session = [[GHEventSession alloc] initWithDictionary:d];
- DLog(@"%@ - %@", [session.startTime description], [session.endTime description]);
+ DLog(@"%@", jsonArray);
- if ([now compare:session.startTime] == NSOrderedDescending &&
- [now compare:session.endTime] == NSOrderedAscending)
- {
- // find the sessions that are happening now
- [arrayCurrentSessions addObject:session];
- }
- else if ([now compare:session.startTime] == NSOrderedAscending)
+ NSDate *nextStartTime = nil;
+ NSDate *now = [NSDate date];
+ DLog(@"%@", now.description);
+
+ for (NSDictionary *d in jsonArray)
{
- // determine the start time of the next block of sessions
- if (nextStartTime == nil)
+ GHEventSession *session = [[GHEventSession alloc] initWithDictionary:d];
+ DLog(@"%@ - %@", [session.startTime description], [session.endTime description]);
+
+ if ([now compare:session.startTime] == NSOrderedDescending &&
+ [now compare:session.endTime] == NSOrderedAscending)
{
- nextStartTime = session.startTime;
+ // find the sessions that are happening now
+ [arrayCurrentSessions addObject:session];
}
-
- if ([nextStartTime compare:session.startTime] == NSOrderedSame)
+ else if ([now compare:session.startTime] == NSOrderedAscending)
{
- // only show the sessions occurring in the next block
- [arrayUpcomingSessions addObject:session];
+ // determine the start time of the next block of sessions
+ if (nextStartTime == nil)
+ {
+ nextStartTime = session.startTime;
+ }
+
+ if ([nextStartTime compare:session.startTime] == NSOrderedSame)
+ {
+ // only show the sessions occurring in the next block
+ [arrayUpcomingSessions addObject:session];
+ }
}
}
}
@@ -176,32 +180,37 @@ - (void)fetchSessionsDidFinishWithData:(NSData *)data
NSMutableArray *arraySessions = [[NSMutableArray alloc] init];
NSMutableArray *arrayTimes = [[NSMutableArray alloc] init];
- NSArray *array = [responseBody yajl_JSON];
- DLog(@"%@", array);
-
- NSMutableArray *arrayBlock = nil;
- NSDate *sessionTime = [NSDate distantPast];
+ NSError *error;
+ NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
- for (NSDictionary *d in array)
+ if (!error)
{
- GHEventSession *session = [[GHEventSession alloc] initWithDictionary:d];
+ DLog(@"%@", array);
- // for each time block create an array to hold the sessions for that block
- if ([sessionTime compare:session.startTime] == NSOrderedAscending)
+ NSMutableArray *arrayBlock = nil;
+ NSDate *sessionTime = [NSDate distantPast];
+
+ for (NSDictionary *d in array)
{
- arrayBlock = [[NSMutableArray alloc] init];
- [arraySessions addObject:arrayBlock];
- [arrayBlock addObject:session];
+ GHEventSession *session = [[GHEventSession alloc] initWithDictionary:d];
- NSDate *date = [session.startTime copyWithZone:NULL];
- [arrayTimes addObject:date];
- }
- else if ([sessionTime compare:session.startTime] == NSOrderedSame)
- {
- [arrayBlock addObject:session];
+ // for each time block create an array to hold the sessions for that block
+ if ([sessionTime compare:session.startTime] == NSOrderedAscending)
+ {
+ arrayBlock = [[NSMutableArray alloc] init];
+ [arraySessions addObject:arrayBlock];
+ [arrayBlock addObject:session];
+
+ NSDate *date = [session.startTime copyWithZone:NULL];
+ [arrayTimes addObject:date];
+ }
+ else if ([sessionTime compare:session.startTime] == NSOrderedSame)
+ {
+ [arrayBlock addObject:session];
+ }
+
+ sessionTime = session.startTime;
}
-
- sessionTime = session.startTime;
}
if ([delegate respondsToSelector:@selector(fetchSessionsByDateDidFinishWithResults:andTimes:)])
@@ -256,16 +265,18 @@ - (void)fetchFavoriteSessionsByEventId:(NSString *)eventId
- (void)fetchFavoriteSessionsDidFinishWithData:(NSData *)data
{
- NSString *responseBody = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- DLog(@"%@", responseBody);
+ DLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
- NSArray *array = [responseBody yajl_JSON];
- DLog(@"%@", array);
-
+ NSError *error;
+ NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
NSMutableArray *arraySessions = [[NSMutableArray alloc] init];
- [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
- [arraySessions addObject:[[GHEventSession alloc] initWithDictionary:obj]];
- }];
+ if (!error)
+ {
+ DLog(@"%@", array);
+ [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ [arraySessions addObject:[[GHEventSession alloc] initWithDictionary:obj]];
+ }];
+ }
if ([delegate respondsToSelector:@selector(fetchFavoriteSessionsDidFinishWithResults:)])
{
@@ -314,16 +325,18 @@ - (void)fetchConferenceFavoriteSessionsByEventId:(NSString *)eventId
- (void)fetchConferenceFavoriteSessionsDidFinishWithData:(NSData *)data
{
- NSString *responseBody = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- DLog(@"%@", responseBody);
-
- NSArray *array = [responseBody yajl_JSON];
- DLog(@"%@", array);
+ DLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
+ NSError *error;
+ NSArray *array = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
NSMutableArray *arraySessions = [[NSMutableArray alloc] init];
- [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
- [arraySessions addObject:[[GHEventSession alloc] initWithDictionary:obj]];
- }];
+ if (!error)
+ {
+ DLog(@"%@", array);
+ [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ [arraySessions addObject:[[GHEventSession alloc] initWithDictionary:obj]];
+ }];
+ }
if ([delegate respondsToSelector:@selector(fetchConferenceFavoriteSessionsDidFinishWithResults:)])
{
View
21 Greenhouse/GHInfoContent.html
@@ -22,27 +22,6 @@
<p><strong>Acknowledgements</strong>
<br />Portions of this Software may utilize the following copyrighted material.</p>
- <p><strong>YAJLIOS</strong>
- <br />Copyright 2009, Gabriel Handford. All rights reserved.</p>
- <p>Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the "Software"), to deal in the Software without
- restriction, including without limitation the rights to use,
- copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following
- conditions:</p>
- <p>The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.</p>
- <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.</p>
-
<p><strong>EGORefreshTableHeaderView</strong>
<br />Copyright 2009 enormego. All rights reserved.</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
View
17 Greenhouse/GHProfileController.m
@@ -55,14 +55,17 @@ - (void)fetchProfile
- (void)fetchProfileDidFinishWithData:(NSData *)data
{
- NSString *responseBody = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- DLog(@"%@", responseBody);
-
- NSDictionary *dictionary = [responseBody yajl_JSON];
- DLog(@"%@", dictionary);
-
- GHProfile *profile = [GHProfile profileWithDictionary:dictionary];
+ DLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
+ NSError *error;
+ NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
+ GHProfile *profile = nil;
+ if (!error)
+ {
+ DLog(@"%@", dictionary);
+ profile = [GHProfile profileWithDictionary:dictionary];
+ }
+
if ([delegate respondsToSelector:@selector(fetchProfileDidFinishWithResults:)])
{
[delegate fetchProfileDidFinishWithResults:profile];
View
24 Greenhouse/GHTwitterController.m
@@ -61,22 +61,22 @@ - (void)fetchTweetsWithURL:(NSURL *)url page:(NSUInteger)page;
- (void)fetchTweetsDidFinishWithData:(NSData *)data
{
- NSString *responseBody = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- DLog(@"%@", responseBody);
+ DLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
NSMutableArray *tweets = [[NSMutableArray alloc] init];
BOOL lastPage = NO;
- NSDictionary *dictionary = [responseBody yajl_JSON];
- DLog(@"%@", dictionary);
-
- lastPage = [dictionary boolForKey:@"lastPage"];
-
- NSArray *jsonArray = (NSArray *)[dictionary objectForKey:@"tweets"];
-
- [jsonArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
- [tweets addObject:[[GHTweet alloc] initWithDictionary:obj]];
- }];
+ NSError *error;
+ NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
+ if (!error)
+ {
+ DLog(@"%@", dictionary);
+ lastPage = [dictionary boolForKey:@"lastPage"];
+ NSArray *jsonArray = (NSArray *)[dictionary objectForKey:@"tweets"];
+ [jsonArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ [tweets addObject:[[GHTweet alloc] initWithDictionary:obj]];
+ }];
+ }
if ([delegate respondsToSelector:@selector(fetchTweetsDidFinishWithResults:lastPage:)])
{
View
3  Greenhouse/Greenhouse-Prefix.pch
@@ -13,9 +13,6 @@
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
- // Frameworks
- #import <YAJLIOS/YAJL.h>
-
//Debug Logging
#import "DLog.h"
Please sign in to comment.
Something went wrong with that request. Please try again.