• 集合之間的轉換


    1、NSArray轉換成NSMutablearray

    NSString *array = @[@“”,@“”,@“”,@“”];

    NSMutaleArray *muarray = [NSMutablearray arrayWithArray:array];

     

    2、NSDictonary 轉換成 NSMutableDictionary

    NSDictionarry *dic = @{@“one”:@“1”,@“two”:@“12”}

    NSMutableDictionary *mDic = [NSMutableDictionarry dictionarryWithDictionarry:dic];

     

    3、NSset 轉成NSMutableSet

    NSSet *set = [[NSSet alloc] initWitheObjects:@“a”,@“d”,nil];

    NSMutableSet *muSet = [NSMutableSet setWithSet:set];

     

    4、NSArray 轉成NSSet

    NSMutableSet*muSet2 = [NSMutableSet setWithArray:array];

     

    5、NSDitionary 轉成NSArray

    NSArray *allkeys = [dic allkeys];

    NSArray *allValues = [dic allValues];

     

    6、字符串转成数组

    NSString *str = @“awww”;

    NSArray *strArray = [str componetsSeparateByString:@“.”];

  • 相关阅读:
    调试
    自定义缓冲函数
    缓冲
    如何控制动画
    开发中遇到过的坑
    动画控制属性
    自定义动画
    CATransition(过渡)
    动画基础(显式动画)
    呈现图层
  • 原文地址:https://www.cnblogs.com/zuozeing/p/3616820.html
Copyright © 2020-2023  润新知