iOS中第三方有序字典框架——M13OrderedDictionary

iOS中第三方有序字典框架——M13OrderedDictionary

1、引言

        M13OrderedDictionary是擁有字典和數組功能的第三方集合序列,開發者能夠經過索引和鍵值來實現對其中元素的訪問。其實現了NSArray和NSDictionary中的全部方法,而且支持KVC與KVO。git

        M13OederedDictionary中提供的方法包括:github

1.建立與初始化。數組

2.訪問鍵和值框架

3.查詢與搜索。優化

4.發送消息。編碼

5.比較與排序。atom

6.枚舉與遍歷。url

7.描述與存儲。spa

8.KVO鍵值監聽。code

9.KVC鍵值編碼。

10.索引與下標。

        另外,M13OrderedDictionary針對Xcode7也作了許多優化,例如引入了泛型的代碼支持的風格。M13OrderedDictionary庫的git地址以下:https://github.com/Marxon13/M13OrderedDictionary

2、M13OrderedDictionary中方法與屬性解析

//類方法建立實例對象
//默認的初始化方法
+ (instancetype)orderedDictionary;
//使用M13OrderedDictionary來建立實例對象
+ (instancetype)orderedDictionaryWithOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
//經過文件來建立實例對象
+ (instancetype)orderedDictionaryWithContentsOfFile:(NSString *)path;
//經過URL來建立實例對象
+ (instancetype)orderedDictionaryWithContentsOfURL:(NSURL *)URL;
//建立單鍵值實例對象
+ (instancetype)orderedDictionaryWithObject:(M13GenericType(ObjectType, id))anObject
                              pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))aKey;
//經過NSDictionary建立實例對象
+ (instancetype)orderedDictionaryWithDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)entries;

//初始化方法建立實例對象
//默認的初始化方法
- (instancetype)init;
//使用M13OrderedDictionary來進行初始化
- (instancetype)initWithOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
//使用M13OrderedDictionary來進行初始化 可選是否對其中元素進行復制操做
- (instancetype)initWithOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary copyEntries:(BOOL)flag;
//經過文件來進行初始化
- (instancetype)initWithContentsOfFile:(NSString *)path;
//經過url來進行初始化
- (instancetype)initWithContentsOfURL:(NSURL *)URL;
//經過NSDictionary對象來進行初始化
- (instancetype)initWithContentsOfDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)entries;
//經過鍵數組與值數組來進行初始化
- (instancetype)initWithObjects:(NSArray M13Generics(ObjectType) *)orderedObjects
                 pairedWithKeys:(NSArray M13Generics(KeyType) *)orderedKeys NS_DESIGNATED_INITIALIZER;

//方法
//判斷字典中是否包含某個元素
- (BOOL)containsObject:(M13GenericType(ObjectType, id))object;
//判斷字典中是否包含某個鍵值對
- (BOOL)containsObject:(M13GenericType(ObjectType, id))object
         pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
//判斷字典中是否包含某個鍵值對 傳入的字典參數須要爲單鍵值字典
- (BOOL)containsEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
//獲取字典中元素個數
@property (nonatomic, readonly) NSUInteger count;
//獲取字典中最後一個元素的值
@property (nonatomic, readonly, M13_NULLABLE) M13GenericType(ObjectType, id) lastObject;
//獲取字典中最後一個元素的鍵
@property (nonatomic, readonly, M13_NULLABLE) M13GenericType(KeyType, id<NSCopying>) lastKey;
//獲取字典中最後一個元素鍵值對
@property (nonatomic, readonly, M13_NULLABLE) NSDictionary M13Generics(KeyType, ObjectType) *lastEntry;
//經過某個下標獲取字典中的元素的值
- (M13GenericType(ObjectType, id))objectAtIndex:(NSUInteger)index;
//經過某個下標獲取字典中的元素的鍵
- (M13GenericType(KeyType, id<NSCopying>))keyAtIndex:(NSUInteger)index;
//經過某個下標獲取字段中的元素 返回的爲單鍵值對NSDictionary對象
- (NSDictionary M13Generics(KeyType, ObjectType) *)entryAtIndex:(NSUInteger)index;
//經過一組下標獲取一組元素的值
- (NSArray M13Generics(ObjectType) *)objectsAtIndices:(NSIndexSet *)indeces;
//經過一組下標獲取一組元素的鍵
- (NSArray M13Generics(KeyType) *)keysAtIndices:(NSIndexSet *)indices;
//經過一組下標獲取一組元素 這個方法獲取的是有序集合
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)entriesAtIndices:(NSIndexSet *)indices;
//經過一組下標獲取一組元素 這個方法獲取的是無序集合
- (NSDictionary M13Generics(KeyType, ObjectType) *)unorderedEntriesAtIndices:(NSIndexSet *)indices;
//示例中包含的無序字典集合
@property (nonatomic, readonly) NSDictionary M13Generics(KeyType, ObjectType) *unorderedDictionary;
//全部鍵組成的數組
@property (nonatomic, readonly) NSArray M13Generics(KeyType) *allKeys;
//全部值組成的數組
@property (nonatomic, readonly) NSArray M13Generics(ObjectType) *allObjects;
//獲取某個值對應的全部鍵組成的數組
- (NSArray M13Generics(KeyType) *)allKeysForObject:(M13GenericType(ObjectType, id))anObject;
//獲取某個鍵對應的值
- (M13_NULLABLE M13GenericType(ObjectType, id))objectForKey:(M13GenericType(KeyType, id<NSCopying>))key;
//獲取某些鍵對應的值 若是沒有找到 則能夠設置默認返回的值 即參數anObject
- (NSArray M13Generics(ObjectType) *)objectForKeys:(NSArray M13Generics(KeyType) *)keys
                                    notFoundMarker:(M13GenericType(ObjectType, id))anObject;
//全部值的枚舉
@property (nonatomic, readonly) NSEnumerator M13Generics(ObjectType) *objectEnumerator;
//全部鍵的枚舉
@property (nonatomic, readonly) NSEnumerator M13Generics(KeyType) *keyEnumerator;
//全部元素的枚舉
@property (nonatomic, readonly) NSEnumerator M13Generics(NSDictionary<KeyType, ObjectType> *) *entryEnumerator;
//全部值的反向枚舉
@property (nonatomic, readonly) NSEnumerator M13Generics(ObjectType) *reverseObjectEnumerator;
//全部鍵的反向枚舉
@property (nonatomic, readonly) NSEnumerator M13Generics(KeyType) *reverseKeyEnumerator;
//全部元素的反向枚舉
@property (nonatomic, readonly) NSEnumerator M13Generics(NSDictionary<KeyType, ObjectType> *) *reverseEntryEnumerator;
//獲取某個值的下標 找不到會返回NSNotFound
- (NSUInteger)indexOfObject:(M13GenericType(ObjectType, id))object;
//獲取某個鍵的下標 找不到會返回NSNotFound
- (NSUInteger)indexOfKey:(M13GenericType(KeyType, id<NSCopying>))key;
//獲取某個元素的下標 找不到會返回NSNotFound
- (NSUInteger)indexOfEntryWithObject:(M13GenericType(ObjectType, id))object
                       pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
//經過NSDictionary來獲取某個元素的下標 找不到會返回NSNotFound
- (NSUInteger)indexOfEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
//經過元素的值在某個範圍內查詢下標
- (NSUInteger)indexOfObject:(M13GenericType(ObjectType, id))object inRange:(NSRange)range;
//經過元素的鍵在某個範圍內查詢下標
- (NSUInteger)indexOfKey:(M13GenericType(KeyType, id<NSCopying>))key inRange:(NSRange)range;
//在某個範圍內查詢某個元素的下標
- (NSUInteger)indexOfEntryWithObject:(M13GenericType(ObjectType, id))object
                       pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key
                             inRange:(NSRange)range;
- (NSUInteger)indexOfEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry inRange:(NSRange)range;
//查找與某個元素的值相同的元素下標
- (NSUInteger)indexOfObjectIdenticalTo:(M13GenericType(ObjectType, id))object;
//查找獲取與某個元素的值相同的元素的鍵
- (M13_NULLABLE M13GenericType(KeyType, id<NSCopying>))keyOfObjectIdenticalTo:(M13GenericType(ObjectType, id))object;
//查找與某個元素的值相同的元素下標 在某個範圍內進行查找
- (NSUInteger)indexOfObjectIdenticalTo:(M13GenericType(ObjectType, id))object inRange:(NSRange)range;
//查找獲取與某個元素的值相同的元素的鍵 在某個範圍內進行查找
- (M13_NULLABLE M13GenericType(KeyType, id<NSCopying>))keyOfObjectIdenticalTo:(M13GenericType(ObjectType, id))object inRange:(NSRange)range;
//符合查找block中檢測條件的元素的下標
/*
開發者能夠在block中獲取到遍歷出的 object與index,返回值決定是否中止查找
*/
- (NSUInteger)indexOfObjectPassingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj,
                                                 NSUInteger idx,
                                                 BOOL *stop))predicate;
//同上 獲取到的是鍵
- (M13_NULLABLE M13GenericType(KeyType, id<NSCopying>))keyOfObjectPassingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj, NSUInteger idx,BOOL *stop))predicate;
//同上 只是這個方法能夠設置枚舉類型
/*
typedef NS_OPTIONS(NSUInteger, NSEnumerationOptions) {
    NSEnumerationConcurrent = (1UL << 0), //正向枚舉
    NSEnumerationReverse = (1UL << 1),    //逆向枚舉
};
*/
- (NSUInteger)indexOfObjectWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj, NSUInteger idx, BOOL *stop))predicate;
//同上 獲取到的是元素
- (M13_NULLABLE M13GenericType(KeyType, id<NSCopying>))keyOfObjectWithOptions:(NSEnumerationOptions)opts passingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj, NSUInteger idx,BOOL *stop))predicate;
//在必定下標集合中進行查找
- (NSUInteger)indexOfObjectAtIndices:(NSIndexSet *)indexSet
                             options:(NSEnumerationOptions)opts
                         passingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj, NSUInteger idx, BOOL *stop))predicate;
//同上
- (M13_NULLABLE M13GenericType(KeyType, id<NSCopying>))keyOfObjectAtIndices:(NSIndexSet *)indexSet options:(NSEnumerationOptions)opts passingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj,NSUInteger idx,BOOL *stop))predicate;
//在範圍內進行比較查詢
- (NSUInteger)indexOfObject:(M13GenericType(ObjectType, id))object
              inSortedRange:(NSRange)r options:(NSBinarySearchingOptions)opts
            usingComparator:(NSComparator)cmp;
//同上
- (M13_NULLABLE M13GenericType(KeyType, id<NSCopying>))keyOfObject:(M13GenericType(ObjectType, id))object
                                                     inSortedRange:(NSRange)r
                                                           options:(NSBinarySearchingOptions)opts
                                                   usingComparator:(NSComparator)cmp;
//進行一組元素下標的查詢
- (NSIndexSet *)indicesOfObjectsPassingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj,
                                                      NSUInteger idx,
                                                      BOOL *stop))predicate;
- (NSIndexSet *)indicesOfObjectsWithOptions:(NSEnumerationOptions)opts
                                passingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj,
                                                      NSUInteger idx,
                                                      BOOL *stop))predicate;
//進行一組元素鍵的查詢
- (NSArray M13Generics(KeyType) *)keysOfObjectsPassingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj,
                                                                     NSUInteger idx,
                                                                     BOOL *stop))predicate;
- (NSArray M13Generics(KeyType) *)keysOfObjectsWithOptions:(NSEnumerationOptions)opts
                                               passingTest:(BOOL (^)(M13GenericType(ObjectType, id) obj,
                                                                     NSUInteger idx,
                                                                     BOOL *stop))predicate;
//向字典中的每個元素髮送消息
- (void)makeObjectsPerformSelector:(SEL)aSelector;
//向字典中的每個元素髮送消息 帶參數
- (void)makeObjectsPerformSelector:(SEL)aSelector withObject:(id)anObject;
//對字典中的元素進行枚舉遍歷
- (void)enumerateObjectsUsingBlock:(void (^)(M13GenericType(ObjectType, id) obj, NSUInteger idx, BOOL *stop))block;
- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts
                         usingBlock:(void (^)(M13GenericType(ObjectType, id) obj, NSUInteger idx, BOOL *stop))block;
//在必定範圍內進行枚舉
- (void)enumerateObjectsAtIndices:(NSIndexSet *)indexSet
                          options:(NSEnumerationOptions)opts
                       usingBlock:(void (^)(M13GenericType(ObjectType, id) obj, NSUInteger idx, BOOL *stop))block;
//獲取與另外一個數組中第一個相同的元素的值
- (M13GenericType(ObjectType, id))firstObjectInCommonWithOrderedDictionary:(M13OrderedDictionary *)otherOrderedDictionary;
//獲取與另外一個數組中第一個相同的元素的鍵
- (M13GenericType(ObjectType, id<NSCopying>))firstKeyInCommonWithOrderedDictionary:(M13OrderedDictionary *)otherOrderedDictionary;
//獲取與另外一個數組中第一個相同的元素
- (NSDictionary M13Generics(KeyType, ObjectType) *)firstEntryInCommonWithOrderedDictionary:(M13OrderedDictionary *)otherOrderedDictionary;
//判斷兩個字典是否相同
- (BOOL)isEqualToOrderedDictionary:(M13OrderedDictionary *)otherOrderedDictionary;
//向字典中追加鍵值對
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionaryByAddingObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))aKey;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionaryByAddingEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
//向字典中追加一組鍵值對
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionaryByAddingObjects:(NSArray M13Generics(ObjectType) *)orderedObjects pairedWithKeys:(NSArray M13Generics(KeyType) *)orderedKeys;
//篩選元素
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)filteredOrderDictionarysUsingPredicateForObjects:(NSPredicate *)predicate;
//獲取必定範圍內的子字典
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)subOrderedDictionaryWithRange:(NSRange)range;
//進行元素排序相關的方法
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByObjectsUsingFunction:(NSInteger (*)(M13GenericType(ObjectType, id),M13GenericType(ObjectType, id),void * M13__NULLABLE))comparator context:(M13_NULLABLE void *)context;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByKeysUsingFunction:(NSInteger (*)(M13GenericType(KeyType, id<NSCopying>),M13GenericType(KeyType, id<NSCopying>),void * M13__NULLABLE))comparator context:(M13_NULLABLE void *)context;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByObjectsUsingFunction:(NSInteger (*)(M13GenericType(ObjectType, id),M13GenericType(ObjectType, id), void * M13__NULLABLE))comparator context:(M13_NULLABLE void *)context hint:(M13_NULLABLE NSData *)hint;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByKeysUsingFunction:(NSInteger (*)(M13GenericType(KeyType, id<NSCopying>),M13GenericType(KeyType, id<NSCopying>),void * M13__NULLABLE))comparator context:(M13_NULLABLE void *)context hint:(M13_NULLABLE NSData *)hint;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByObjectsUsingDescriptors:(NSArray *)descriptors;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByKeysUsingDescriptors:(NSArray *)descriptors;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByObjectsUsingSelector:(SEL)comparator;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByKeysUsingSelector:(SEL)comparator;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByObjectsUsingComparator:(NSComparator)cmptr;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByKeysUsingComparator:(NSComparator)cmptr;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByObjectsWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr;
- (M13OrderedDictionary M13Generics(KeyType, ObjectType) *)sortedByKeysWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr;
//寫入文件
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag;
//寫入到URL
- (BOOL)writeToURL:(NSURL *)aURL atomically:(BOOL)flag;
//添加監聽
- (void)addObserver:(NSObject *)anObserver toObjectsAtIndices:(NSIndexSet *)indices forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(M13_NULLABLE void *)context;
- (void)addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(M13_NULLABLE void *)context;
//移除監聽
- (void)removeObserver:(NSObject *)anObserver fromObjectsAtIndices:(NSIndexSet *)indices forKeyPath:(NSString *)keyPath;
- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath context:(M13_NULLABLE void *)context;
//KVC相關方法
- (void)setValue:(M13_NULLABLE id)value forKey:(NSString *)key;
- (void)setValue:(M13_NULLABLE id)value forKeyPath:(NSString *)keyPath;
- (id)valueForKey:(NSString *)key;
- (id)valueForKeyPath:(NSString *)keyPath;
//歸檔相關方法
- (void)encodeWithCoder:(NSCoder *)aCoder;
- (id)initWithCoder:(NSCoder *)decoder;
//copy相關方法
- (id)copy;
- (id)copyWithZone:(M13_NULLABLE NSZone *)zone;
- (id)mutableCopy;
- (id)mutableCopyWithZone:(NSZone *)zone;

3、M13MutableOrderedDictionary

        基於M13OrderedDictionary,M13MutableOrderedDictionary爲可變的有序字典類,其中方法解析以下:

//類建立方法
+ (instancetype)orderedDictionaryWithCapacity:(NSUInteger)numEntries;
//初始化方法
- (id)initWithCapacity:(NSUInteger)numEntries;
//添加鍵值對的方法
- (void)addObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)addEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
- (void)addEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
- (void)addEntriesFromDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)dictionary;
//插入鍵值對的方法
- (void)insertObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key atIndex:(NSUInteger)index;
- (void)insertEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry atIndex:(NSUInteger)index;
- (void)insertEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary atIndex:(NSUInteger)index;
- (void)insertEntriesFromDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)dictionary atIndex:(NSUInteger)index;
//設置鍵值對的方法
- (void)setObject:(M13GenericType(ObjectType, id))object forKey:(M13GenericType(KeyType, id<NSCopying>))aKey;
- (void)setEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
- (void)setEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
- (void)setEntriesFromDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)dictionary;
- (void)setObject:(M13GenericType(ObjectType, id))object forKey:(M13GenericType(KeyType, id<NSCopying>))aKey atIndex:(NSUInteger)index;
- (void)setEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry atIndex:(NSUInteger)index;
- (void)setEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary atIndex:(NSUInteger)index;
- (void)setEntriesFromDictionary:(NSDictionary M13Generics(KeyType, ObjectType) *)dictionary atIndex:(NSUInteger)index;
//移除鍵值對的方法
- (void)removeObjectForKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)removeObjectsForKeys:(NSArray M13Generics(KeyType) *)keys;
- (void)removeAllObjects;
- (void)removeAllEntries;
- (void)removeLastEntry;
- (void)removeEntryWithObject:(M13GenericType(ObjectType, id))object;
- (void)removeEntryWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)removeEntryWithObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)removeEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
- (void)removeEntryWithObject:(M13GenericType(ObjectType, id))object inRange:(NSRange)range;
- (void)removeEntryWithKey:(M13GenericType(KeyType, id<NSCopying>))key inRange:(NSRange)range;
- (void)removeEntryWithObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key inRange:(NSRange)ramge;
- (void)removeEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry inRange:(NSRange)range;
- (void)removeEntryAtIndex:(NSUInteger)index;
- (void)removeEntriesAtIndices:(NSIndexSet *)indices;
- (void)removeEntryWithObjectIdenticalTo:(M13GenericType(ObjectType, id))anObject;
- (void)removeEntryWithObjectIdenticalTo:(M13GenericType(ObjectType, id))anObject inRange:(NSRange)range;
- (void)removeEntriesWithObjectsInArray:(NSArray M13Generics(ObjectType) *)array;
- (void)removeEntriesWithKeysInArray:(NSArray M13Generics(KeyType) *)array;
- (void)removeEntriesInRange:(NSRange)range;
//替換鍵值對的方法
- (void)replaceEntryAtIndex:(NSInteger)index withObject:(M13GenericType(ObjectType, id))object pairedWithKey:(M13GenericType(KeyType, id<NSCopying>))key;
- (void)replaceEntryAtIndex:(NSUInteger)index withEntry:(NSDictionary M13Generics(KeyType, ObjectType) *)entry;
- (void)replaceEntriesAtIndices:(NSIndexSet *)indices
                    withObjects:(NSArray M13Generics(ObjectType) *)objects
                 pairedWithKeys:(NSArray M13Generics(KeyType) *)keys;
- (void)replaceEntriesAtIndices:(NSIndexSet *)indices
                    withEntries:(NSArray M13Generics(NSDictionary<KeyType, ObjectType> *) *)orderedEntries;
- (void)replaceEntriesAtIndices:(NSIndexSet *)indices
withEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
- (void)replaceEntriesInRange:(NSRange)range
         withObjectsFromArray:(NSArray M13Generics(ObjectType) *)objects
      pairedWithKeysFromArray:(NSArray M13Generics(KeyType) *)keys
                      inRange:(NSRange)range2;
- (void)replaceEntriesInRange:(NSRange)range
              withEntriesFrom:(NSArray M13Generics(NSDictionary<KeyType, ObjectType> *) *)orderedEntries
                      inRange:(NSRange)range2;
- (void)replaceEntriesInRange:(NSRange)range
withEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)dictionary
                      inRange:(NSRange)range2;
- (void)replaceEntriesInRange:(NSRange)range
         withObjectsFromArray:(NSArray M13Generics(ObjectType) *)objects
      pairedWithKeysFromArray:(NSArray M13Generics(KeyType) *)keys;
- (void)replaceEntriesInRange:(NSRange)range
              withEntriesFrom:(NSArray M13Generics(NSDictionary<KeyType, ObjectType> *) *)orderedEntries;
- (void)replaceEntriesInRange:(NSRange)range
withEntriesFromOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)dictionary;
- (void)setEntriesToObjects:(NSArray M13Generics(ObjectType) *)objects pairedWithKeys:(NSArray M13Generics(KeyType) *)keys;
- (void)setEntriesToOrderedDictionary:(M13OrderedDictionary M13Generics(KeyType, ObjectType) *)orderedDictionary;
//進行元素篩選
- (void)filterEntriesUsingPredicateForObjects:(NSPredicate *)predicate;
//進行元素交換
- (void)exchangeEntryAtIndex:(NSUInteger)idx1 withEntryAtIndex:(NSUInteger)idx2;
//進行元素排序
- (void)sortEntriesByObjectUsingDescriptors:(NSArray *)descriptors;
- (void)sortEntriesByKeysUsingDescriptors:(NSArray *)descriptors;
- (void)sortEntriesByObjectUsingComparator:(NSComparator)cmptr;
- (void)sortEntriesByKeysUsingComparator:(NSComparator)cmptr;
- (void)sortEntriesByObjectWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr;
- (void)sortEntriesByKeysWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr;
- (void)sortEntriesByObjectUsingFunction:(NSInteger (*)(M13GenericType(ObjectType, id),
                                                        M13GenericType(ObjectType, id),
                                                        void * M13__NULLABLE))compare
                                 context:(M13_NULLABLE void *)context;
- (void)sortEntriesByKeysUsingFunction:(NSInteger (*)(M13GenericType(KeyType, id<NSCopying>),
                                                      M13GenericType(KeyType, id<NSCopying>),
                                                      void * M13__NULLABLE))compare
                               context:(M13_NULLABLE void *)context;
- (void)sortEntriesByObjectUsingSelector:(SEL)comparator;
- (void)sortEntriesByKeysUsingSelector:(SEL)comparator;

專一技術,熱愛生活,交流技術,也作朋友。

——琿少 QQ羣:203317592

相關文章
相關標籤/搜索