CocoaPods trunk is moving to be read-only. Read more on the blog, there are 13 months to go.
| TestsTested | ✗ |
| LangLanguage | Obj-CObjective C |
| License | MIT |
| ReleasedLast Release | Oct 2017 |
Maintained by Chuong Huynh.
NSMutableArray, NSMutableDictionary is threadunsafe (race condition would appear when a NSMutableArray, NSMutableDictionary accessed from multiple threads). This project is a threadsafe wrapper, which provides base methods for creating, adding, removing and accessing object in an array without race condition.
HMCThreadSafeMutableArray *array = [[HMCThreadSafeMutableArray alloc] init];NSArray *array = @[@1,@2,@3];
HMCThreadSafeMutableArray *tsarray = [[HMCThreadSafeMutableArray alloc] initWithArray:array];- (void)addObject:(NSObject *)object;- (void)addObjectsFromArray:(NSArray *)array;- (void)insertObject:(NSObject *)object
atIndex:(NSUInteger)index;- (void)removeObject:(NSObject *)object;- (void)removeObjectAtIndex:(NSUInteger)index;- (void)removeAllObjects;- (id)objectAtIndex:(NSUInteger)index;- (NSUInteger)count;- (NSArray *)filteredArrayUsingPredicate: (NSPredicate *) predicate;- (NSInteger)indexOfObject: (NSObject *)object;- (BOOL)containsObject: (id)object;- (NSArray *)toNSArray;HMCThreadSafeMutableDictionary *dict = [[HMCThreadSafeMutableDictionary alloc] init];dict[@"a"] = @1;
id object = dict[@"a"];- (void)removeAllObjects;- (void)removeObjectForkey:(NSString *)key;- (NSDictionary *)toNSDictionary;chuonghuynh, [email protected]
HMCThreadSafeMutableCollection is available under the MIT license. See the LICENSE file for more info.