工程安全类,解决项目中经常遇到的数组越界、字典键值对为空操作等闪退问题

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    //Array
    NSArray *array  = @[@1, @2];
    
    NSLog(@"index==== %@", array[2]);

    NSMutableArray *muArray = [[NSMutableArray alloc] initWithObjects:@"1", nil];
    NSLog(@"****");
    NSLog(@"=======muarray %@", muArray[2]);

    [muArray replaceObjectAtIndex:3 withObject:@""];
    [muArray replaceObjectAtIndex:0 withObject:nil];
    [muArray insertObject:@2 atIndex:2];


    //Dict
    NSMutableDictionary *muDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"obj", @"key", nil];

    [muDict setObject:nil forKey:@"1"];
    [muDict setObject:@"1" forKey:nil];