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
//
// NSMutableArray+SafeInsert.h
// XFFruit
//
// Created by Xummer on 4/10/15.
// Copyright (c) 2015 Xummer. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSMutableArray (SafeInsert)
- (void)safeAddObject:(id)object;
- (void)safeInsertObject:(id)object atIndex:(NSUInteger)index;
- (void)safeRemoveObjectAtIndex:(NSUInteger)index;
- (void)safeReplaceObjectAtIndex:(NSUInteger)index withObject:(id)object;
- (void)removeFirstObject;
@end
@interface NSMutableDictionary (SafeInsert)
- (void)safeSetObject:(id)object forKey:(id<NSCopying>)key;
- (void)safeRemoveObjectForKey:(id)key;
@end
@interface NSMutableSet (SafeInsert)
- (void)safeAddObject:(id)object;
- (void)safeRemoveObject:(id)object;
@end
@interface NSMutableString (SafeInsert)
- (void)safeAppendString:(NSString *)string;
@end
@interface NSArray (SafeFetch)
- (id)safeObjectAtIndex:(NSUInteger)index;
@end