-
Notifications
You must be signed in to change notification settings - Fork 2
/
XMPPStanza.m
44 lines (41 loc) · 983 Bytes
/
XMPPStanza.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
//
// XMPPStanza.m
// Jabber
//
// Created by David Chisnall on 19/11/2007.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import "XMPPStanza.h"
#import <EtoileFoundation/EtoileFoundation.h>
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
@implementation XMPPStanza
- (id) initWithXMLParser: (ETXMLParser*) aParser
key: (id) aKey
{
self = [super initWithXMLParser: aParser
key: aKey];
if (nil == self)
{
return nil;
}
children = [[NSMutableDictionary alloc] init];
return self;
}
- (void) addChild:(id)aChild forKey:(id)aKey
{
NSString * childSelectorName = [NSString stringWithFormat:@"add%@:", aKey];
SEL childSelector = NSSelectorFromString(childSelectorName);
if([self respondsToSelector: childSelector])
{
[self performSelector: childSelector withObject:aChild];
}
else
{
[children setValue:aChild forKey:aKey];
}
}
- (NSDictionary*) children
{
return children;
}
@end