-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObserver.m
More file actions
36 lines (24 loc) · 679 Bytes
/
Copy pathObserver.m
File metadata and controls
36 lines (24 loc) · 679 Bytes
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
//
// Observer.m
//
// Licensed by ruralcoder.com under the
// Creative Commons Attribution-ShareAlike 3.0 Unported License
#import "Observer.h"
@implementation Observer
+ (id) createObserverWithTarget:(id)target andCookie:(id)cookie
{
NSParameterAssert(target);
NSParameterAssert(cookie);
NSDictionary *fields = [NSDictionary dictionaryWithObjectsAndKeys:target, @"target", cookie, @"cookie", nil];
Observer *object = [[[Observer alloc] initWithDictionary:fields] autorelease];
return object;
}
- (id) target
{
return [self.fields objectForKey:@"target"];
}
- (id) cookie
{
return [self.fields objectForKey:@"cookie"];
}
@end