-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRGToIOSManaager.m
More file actions
50 lines (37 loc) · 826 Bytes
/
RGToIOSManaager.m
File metadata and controls
50 lines (37 loc) · 826 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// RGToIOSManaager.m
// Unity-iPhone
//
// Created by xiaochuan on 14-5-19.
//
//
#import "RGToIOSManaager.h"
#import "ToiOS.h"
@implementation RGToIOSManaager
static RGToIOSManaager *_manager;
+ (RGToIOSManaager *)sharedManager{
if (!_manager) {
_manager = [[RGToIOSManaager alloc] init];
}
return _manager;
}
- (id)init{
if (self = [super init]) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receive:) name:RG_TO_IOS_KEY object:nil];
}
return self;
}
- (void)receive:(NSNotification *)noti{
NSDictionary *dic = noti.object;
/**
{
key: @"key",
value: @"value"
}
*/
}
- (void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:RG_TO_IOS_KEY];
[super dealloc];
}
@end