Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ff9733ac39
Fetching contributors…

Cannot retrieve contributors at this time

90 lines (76 sloc) 1.531 kb
//
// MGTwitterStatusesYAJLParser.m
// MGTwitterEngine
//
// Created by Matt Gemmell on 11/02/2008.
// Copyright 2008 Instinctive Code.
//
#import "MGTwitterStatusesYAJLParser.h"
#define DEBUG_PARSING 0
@implementation MGTwitterStatusesYAJLParser
- (void)addValue:(id)value forKey:(NSString *)key
{
if (_user)
{
[_user setObject:value forKey:key];
#if DEBUG_PARSING
NSLog(@"status: user: %@ = %@ (%@)", key, value, NSStringFromClass([value class]));
#endif
}
else if (_status)
{
[_status setObject:value forKey:key];
#if DEBUG_PARSING
NSLog(@"status: status: %@ = %@ (%@)", key, value, NSStringFromClass([value class]));
#endif
}
}
- (void)startDictionaryWithKey:(NSString *)key
{
#if DEBUG_PARSING
NSLog(@"status: dictionary start = %@", key);
#endif
if (! _status)
{
_status = [[NSMutableDictionary alloc] initWithCapacity:0];
}
else
{
if (! _user)
{
_user = [[NSMutableDictionary alloc] initWithCapacity:0];
}
}
}
- (void)endDictionary
{
if (_user)
{
[_status setObject:_user forKey:@"user"];
[_user release];
_user = nil;
}
else
{
[_status setObject:[NSNumber numberWithInt:requestType] forKey:TWITTER_SOURCE_REQUEST_TYPE];
[parsedObjects addObject:_status];
[_status release];
_status = nil;
}
#if DEBUG_PARSING
NSLog(@"status: dictionary end");
#endif
}
- (void)startArrayWithKey:(NSString *)key
{
#if DEBUG_PARSING
NSLog(@"status: array start = %@", key);
#endif
}
- (void)endArray
{
#if DEBUG_PARSING
NSLog(@"status: array end");
#endif
}
@end
Jump to Line
Something went wrong with that request. Please try again.