NSMutableArray(FWSafeType)

@interface NSMutableArray<ObjectType> (FWSafeType)

/**
 安全添加对象
 
 @param object 对象
 */
- (void)fw_addObject:(nullable ObjectType)object NS_REFINED_FOR_SWIFT;

/**
 安全移除指定索引对象
 
 @param index 索引
 */
- (void)fw_removeObjectAtIndex:(NSInteger)index NS_REFINED_FOR_SWIFT;

/**
 安全插入对象到指定位置
 
 @param object 对象
 @param index 索引
 */
- (void)fw_insertObject:(nullable ObjectType)object atIndex:(NSInteger)index NS_REFINED_FOR_SWIFT;

/**
 安全替换对象到指定位置
 
 @param index 索引
 @param object 对象
 */
- (void)fw_replaceObjectAtIndex:(NSInteger)index withObject:(nullable ObjectType)object NS_REFINED_FOR_SWIFT;

/**
 安全移除子数组
 
 @param range 范围
 */
- (void)fw_removeObjectsInRange:(NSRange)range NS_REFINED_FOR_SWIFT;

/**
 安全插入数组到指定位置
 
 @param objects 要插入的数组
 @param index 索引
 */
- (void)fw_insertObjects:(nullable NSArray *)objects atIndex:(NSInteger)index NS_REFINED_FOR_SWIFT;

@end

Undocumented

  • 安全添加对象

    Declaration

    Objective-C

    - (void)fw_addObject:(nullable ObjectType)object;

    Parameters

    object

    对象

  • 安全移除指定索引对象

    Declaration

    Objective-C

    - (void)fw_removeObjectAtIndex:(NSInteger)index;

    Parameters

    index

    索引

  • 安全插入对象到指定位置

    Declaration

    Objective-C

    - (void)fw_insertObject:(nullable ObjectType)object atIndex:(NSInteger)index;

    Parameters

    object

    对象

    index

    索引

  • 安全替换对象到指定位置

    Declaration

    Objective-C

    - (void)fw_replaceObjectAtIndex:(NSInteger)index
                         withObject:(nullable ObjectType)object;

    Parameters

    index

    索引

    object

    对象

  • 安全移除子数组

    Declaration

    Objective-C

    - (void)fw_removeObjectsInRange:(NSRange)range;

    Parameters

    range

    范围

  • 安全插入数组到指定位置

    Declaration

    Objective-C

    - (void)fw_insertObjects:(nullable NSArray *)objects atIndex:(NSInteger)index;

    Parameters

    objects

    要插入的数组

    index

    索引