-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathELCConsole.m
68 lines (57 loc) · 1.1 KB
/
ELCConsole.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
//
// ELCConsole.m
// ELCImagePickerDemo
//
// Created by Seamus on 14-7-11.
// Copyright (c) 2014年 ELC Technologies. All rights reserved.
//
#import "ELCConsole.h"
static ELCConsole *_maniconsole;
@implementation ELCConsole
+ (ELCConsole *)mainConsole
{
if (!_maniconsole) {
_maniconsole = [[ELCConsole alloc] init];
}
return _maniconsole;
}
- (id)init
{
self = [super init];
if (self) {
myIndex = [[NSMutableArray alloc] init];
}
return self;
}
- (void)dealloc
{
myIndex = nil;
_maniconsole = nil;
}
- (void)addIndex:(int)index
{
if (![myIndex containsObject:@(index)]) {
[myIndex addObject:@(index)];
}
}
- (void)removeIndex:(int)index
{
[myIndex removeObject:@(index)];
}
- (void)removeAllIndex
{
[myIndex removeAllObjects];
}
- (int)currIndex
{
[myIndex sortUsingSelector:@selector(compare:)];
// NSLog(@"%@",myIndex);
for (int i = 0; i < [myIndex count]; i++) {
int c = [[myIndex objectAtIndex:i] intValue];
if (c != i) {
return i;
}
}
return (int)[myIndex count];
}
@end