-
Notifications
You must be signed in to change notification settings - Fork 164
/
MGTwitterMiscYAJLParser.m
77 lines (61 loc) · 1.22 KB
/
MGTwitterMiscYAJLParser.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// MGTwitterMiscYAJLParser.m
// MGTwitterEngine
//
// Created by Matt Gemmell on 11/02/2008.
// Copyright 2008 Instinctive Code.
//
#import "MGTwitterMiscYAJLParser.h"
#define DEBUG_PARSING 0
@implementation MGTwitterMiscYAJLParser
- (void)addValue:(id)value forKey:(NSString *)key
{
if (_results)
{
[_results setObject:value forKey:key];
#if DEBUG_PARSING
NSLog(@"misc: results: %@ = %@ (%@)", key, value, NSStringFromClass([value class]));
#endif
}
}
- (void)startDictionaryWithKey:(NSString *)key
{
#if DEBUG_PARSING
NSLog(@"misc: dictionary start = %@", key);
#endif
if (! _results)
{
_results = [[NSMutableDictionary alloc] initWithCapacity:0];
}
}
- (void)endDictionary
{
[_results setObject:[NSNumber numberWithInt:requestType] forKey:TWITTER_SOURCE_REQUEST_TYPE];
[self _parsedObject:_results];
if(_results){
[parsedObjects addObject:_results];
}
[_results release];
_results = nil;
#if DEBUG_PARSING
NSLog(@"misc: dictionary end");
#endif
}
- (void)startArrayWithKey:(NSString *)key
{
#if DEBUG_PARSING
NSLog(@"misc: array start = %@", key);
#endif
}
- (void)endArray
{
#if DEBUG_PARSING
NSLog(@"misc: array end");
#endif
}
- (void)dealloc
{
[_results release];
[super dealloc];
}
@end