NSString NSArray NSDictionary NSSet 中的部分方法

NSString NSArray NSDictionary NSSet 中的部分方法


   
    
    //1、init
    //    NSString  *s1 = [[NSString alloc]init];
    
    //2、initWithBytes:length:encoding:
    //    NSString *s2 = [[NSString alloc] initWithBytes:@"aaaa" length:2 encoding:NSUTF8StringEncoding];
    //
    
    //3、initWithCharacters:length:
    //    NSString *s3 = [[NSString alloc]initWithCharacters:"e" length:2];
    
    //    4、initWithCString:encoding:   以标准形式输出  输出汉字  与10对应
    //    NSString *s4 = [[NSString alloc]initWithCString:"aaaa" encoding:NSUTF8StringEncoding];
    //
    //    NSLog(@"%@",s4);
    
    
    //    5、initWithUTF8String:  //将字符串转化为oc的字符串格式
    //    NSString *s5 = [[NSString alloc]initWithUTF8String:"abcde"];
    //    NSLog(@"%@",s5);
    
    //    6、initWithFormat:   //对象初始化     retaincount = 1
    //    NSString *s6 = [[NSString alloc] initWithFormat:@"%d",123];
    
    //    7、stringWithFormat:   //便利构造器
    //    NSString *s7 = [NSString stringWithFormat:@"%d",5550];
    
    //    8、stringWithCharacters:length:
    //    NSString *s8 = [NSString stringWithCharacters:@"aaa" length:4];
    
    //    9、stringWithString:   直接打印  与3对应   retaincount = -1
    //    NSString *s9 = [NSString stringWithString:@"abcd"];
    
    //    10、stringWithCString:encoding:
    
    //    NSString *s10 = [NSString stringWithCString:"aaa" encoding:NSUTF8StringEncoding];
    //    NSLog(@"%@",s10);
    
    //    11、stringWithUTF8String:  与5对应
    //    NSString *s5 = [NSString stringWithUTF8String:"abcde"];
    //    NSLog(@"%@",s5);
    
    //    12、length   求字符串长度
    //    NSString *s7 = [NSString stringWithFormat:@"%d",5550];
    //    NSLog(@"%ld",(unsigned long)[s7 length]);
    
    //    13、lengthOfBytesUsingEncoding:  同12   就是打印
    //    NSString *s7 = [NSString stringWithFormat:@"%d",5550];
    //    int long  length2 = [s7 lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
    //    NSLog(@"length2 = %ld ",length2);
    
    //    14、characterAtIndex:  取当前指定字符下标的字符
    //    NSString *s7 = [NSString stringWithFormat:@"%d",5550];
    //    char a = [s7 characterAtIndex:2];
    //    NSLog(@"%c",a );
    
    //    15、getCharacters:range:   去第几个值 取几个 存到一个数组中
    //    NSString *s1 = [NSString stringWithFormat:@"%@",@"abcdefg"];
    //    unichar a[10];
    //    NSRange range = NSMakeRange(4, 2);
    //    [s1 getCharacters:a range:range];
    //输出数组a
    
    
    //    16、cStringUsingEncoding:  转化成c 类型的字符串
    //    NSString *s2 =[NSString stringWithFormat:@"%@",@"abcdefg"];
    //    const char *s1 = [s2 cStringUsingEncoding:NSUTF8StringEncoding];
    //
    //    NSLog(@"%s",s1);
    
    //    17、UTF8String
    //    NSString *s2 =[NSString stringWithFormat:@"%@",@"abcdefg"];
    //    const char *s1 = [s2 UTF8String];
    //    NSLog(@"%s",s1);
    
    //    18、stringByAppendingFormat:字符串的追加  追加单个字符
    //    NSString *s2 =[NSString stringWithFormat:@"%@",@"abcdefg"];
    //    NSString *s3 = [s2 stringByAppendingFormat:@"A"];
    
    //    19、stringByAppendingString:字符串的追加
    //    NSString *s2 =[NSString stringWithFormat:@"%@",@"abcdefg"];
    //    NSString *s3 = [s2 stringByAppendingString:@"AAAAAAAAA"];
    
    
    //    20、stringByPaddingToLength:withString:startingAtIndex:  从下表开始追加什么 追加几个
    //    NSString *s2 =[NSString stringWithFormat:@"%@",@"abc"];
    //    NSString *s3 = [s2 stringByPaddingToLength:9 withString:@"." startingAtIndex:0];
    //    NSLog(@"%@",s3);
    
    //    21、componentsSeparatedByString:  以某个字符分开字符串
    //    NSString *s2 =[NSString stringWithFormat:@"a bc"];
    //    NSArray  *ar1 =[s2 componentsSeparatedByString:@" "];
    //    NSLog(@"%@",ar1);
    
    
    
    //    22、componentsSeparatedByCharactersInSet:
    //    NSString *s2 =[NSString stringWithFormat:@"%@",@"a bc"];
    //    NSArray  *ar1 =[s2 componentsSeparatedByCharactersInSet];
    
    //    23、substringFromIndex   求子字符串  从第几个开始取  一直取到最后
    //    NSString *s = [NSString stringWithFormat:@"abcde"];
    //    NSString *s1 = [s substringFromIndex:2];
    
    //    24、substringWithRange:
    //    NSString *s = [NSString stringWithFormat:@"abcde"];
    //    NSString *s1 = [s substringWithRange:NSMakeRange(0, 4)];
    //    NSLog(@"%@",s1);
    
    //    25、substringToIndex: 求子字符串  从0 开始取   一共去几个
    //    NSString *s = [NSString stringWithFormat:@"abcde"];
    //    NSString *s1 = [s substringFromIndex:2];
    
    //    26、rangeOfString:  从开始找字符串  输出range
    //    NSString *str7 = [[NSString alloc]initWithFormat:@"%s","bin ing"];
    //    NSRange r1 = [str7 rangeOfString:@"in"];
    //    NSLog(@"%lu,%lu",r1.location,r1.length);
    
    //    27、rangeOfString:options:  从后面开始找
    //    NSString *str7 = [[NSString alloc]initWithFormat:@"%s","bining"];
    //    NSRange r2 = [str7 rangeOfString:@"in" options:NSBackwardsSearch];
    //    NSLog(@"%lu,%lu",r2.location,r2.length);
    
    //    28、rangeOfString:options:range:从一段范围内开始找
    
    
    //    29、stringByReplacingOccurrencesOfString:withString:   用字符串代替字符创
    
    //    NSString *str7 = [[NSString alloc]initWithFormat:@"%s","bining"];
    //    NSString *s =[str7 stringByReplacingOccurrencesOfString:@"in" withString:@"**"];
    //    NSLog(@"%@",s);
    
    // 不懂   30、stringByReplacingOccurrencesOfString:withString:options:range:
    //    NSString *str7 = [[NSString alloc]initWithFormat:@"%s","binin8inininig"];
    //    NSLog(@"%@",[str7 stringByReplacingOccurrencesOfString:@"in" withString:@"**" options:NSAnchoredSearch range:NSMakeRange(0, 13)]);
    
    //    31、stringByReplacingCharactersInRange:withString:  范围内的字符串被替代为  字符串
    //    NSString *str7 = [[NSString alloc]initWithFormat:@"%s","binin8inininig"];
    //    NSString *str =  [str7 stringByReplacingCharactersInRange:NSMakeRange(0, 3) withString:@"*"];
    //    NSLog(@"%@",str);
    
    
    
    //    32、caseInsensitiveCompare:   比较两个字符创输出枚举值  升  为1 降  -1
    //    NSString *str7 = [[NSString alloc]initWithFormat:@"%s","a"];
    //    NSInteger NSComparisonResult = [str7 caseInsensitiveCompare:@"b"];
    //    NSLog(@"%ld",(long)NSComparisonResult);
    
    //    33、compare:两个字符串的比较
    //    NSInteger NSComparisonResult = [@"a" compare:@"b"];
    //    NSLog(@"%ld",(long)NSComparisonResult);
    
    
    
    //    34、compare:options:   从后往前比较  字符串大小
    //    NSString *s1 = [[NSString alloc]initWithFormat:@"arfgaerwf"];
    //    NSString *s2 = [[NSString alloc]initWithFormat:@"bdfs"];
    //    NSInteger NSComparisonResult = [s1 compare:s2 options:NSBackwardsSearch];
    //    NSLog(@"%ld",(long)NSComparisonResult);
    
    //    35、compare:options:range:
    //    NSString *s1 = [[NSString alloc]initWithFormat:@"arfgaerwf"];
    //    NSString *s2 = [[NSString alloc]initWithFormat:@"bdfs"];
    //    NSInteger NSComparisonResult = [s1 compare:s2 options:NSBackwardsSearch range:NSMakeRange(0, 2)];
    //    NSLog(@"%ld",(long)NSComparisonResult);
    
    
    //    36、hasPrefix:  是否有前缀
    //    NSString *s1 = [[NSString alloc]initWithFormat:@"arfgaerwf"];
    //    NSInteger b1 = [s1 hasPrefix:@"a"];
    
    
    //    37、hasSuffix:是否有后缀
    //    NSString *s1 = [[NSString alloc]initWithFormat:@"arfgaerwf"];
    //    NSInteger b1 = [s1 hasSuffix:@"a"];
    
    //    38、isEqualToString:
    
    //    39、capitalizedString    首字母大写
    //    NSString *s1 = [[NSString alloc]initWithFormat:@"arfgaerwf"];
    //    NSLog(@"%@",[s1 capitalizedString]);
    
    //    40、lowercaseString     所有小写
    //    NSString *s1 = [[NSString alloc]initWithFormat:@"AAAfgaerwf"];
    //    NSLog(@"%@",[s1 lowercaseString]);
    
    //    41、uppercaseString   所有大写
    //    NSString *s1 = [[NSString alloc]initWithFormat:@"AAAfgaerwf"];
    //    NSLog(@"%@",[s1 uppercaseString]);
    
    //    42、doubleValue
    //    NSLog(@"%lf",[@"12.3" doubleValue]);
    
    //    43、floatValue
    //    NSLog(@"%lf",[@"12.3" floatValue]);
    
    //    44、intValue
    //    NSLog(@"%d",[@"123" intValue]);
    
    //    45、integerValue
    //    NSLog(@"%ld",(long)[@"12.3" integerValue]);
    
    //    46、longLongValue
    //    NSLog(@"%lld",[@"12.3" longLongValue]);
    
    //    47、boolValue
    //    NSLog(@"%d",[@"12.3" boolValue]);
    //
    
    //       NSMutableString  可变字符串
    
    
    
    //    48、stringWithCapacity:  创建一个字符串,容量为size大小
    //    NSMutableString *s1 = [NSMutableString stringWithCapacity:3];
    
    
    //    49、initWithCapacity:  初始化一个字符串,容量为size
    //    NSMutableString *s1 = [[NSMutableString alloc] initWithCapacity:3];
    
    //    50、appendFormat:   增加一个字符串
    //    NSMutableString *s1 = [[NSMutableString alloc] initWithFormat:@"qqq"];
    //    [s1 appendFormat:@"!!!!"];
    //    NSLog(@"%@",s1);
    
    
    //    51、appendString:
    //    NSMutableString *s1 = [[NSMutableString alloc] initWithFormat:@"qqq"];
    //    [s1 appendString:@"!!!!"];
    //    NSLog(@"%@",s1);
    
    //    52、deleteCharactersInRange:删除一个范围类的
    //    NSMutableString *s1 = [[NSMutableString alloc] initWithFormat:@"abcdefg"];
    //    [s1 deleteCharactersInRange:NSMakeRange(2, 4)];
    //    NSLog(@"%@",s1);
    
    
    //    53、insertString:atIndex:在下标插入字符串
    //    NSMutableString *s1 = [[NSMutableString alloc] initWithFormat:@"abcdefg"];
    //    [s1 insertString:@"222" atIndex:2];
    //    NSLog(@"%@",s1);
    
    //    54、replaceCharactersInRange:withString:  在某个范围内用某字符串取代
    //    NSMutableString *s1 = [[NSMutableString alloc] initWithFormat:@"abcdefguyu"];
    //    [s1 replaceCharactersInRange:NSMakeRange(2, 5) withString:@"***"];
    //    NSLog(@"%@",s1);
    
    //    55、replaceOccurrencesOfString:withString:options:range:
    //    NSMutableString *s1 = [[NSMutableString alloc] initWithFormat:@"efefefguyu"];
    //    [s1 replaceOccurrencesOfString:@"ef" withString:@"*" options:NSBackwardsSearch range:NSMakeRange(3,5)];
    //    NSLog(@"%@",s1);
    
    //    56、setString:  用后面的字符串取代前面面
    //    NSMutableString *s1 = [[NSMutableString alloc] initWithFormat:@"abcdefguyu"];
    //    [s1 setString:@"QfgQ"];
    //    NSLog(@"%@",s1);
    //
    //
    //    1、array
    //    NSArray *a1 = [NSArray array];
    
    //    2、arrayWithArray:  用数组初始化另外一个数组
    //    NSArray *a1 = [NSArray array];
    //    NSArray *a2 = [NSArray arrayWithArray:a1];
    
    //    3、arrayWithObject:  初始化  一个数组元素
    //    NSArray *a2 = [NSArray arrayWithObject: @"1"];
    
    //    4、arrayWithObjects:
    //    NSArray *a1 = [NSArray arrayWithObjects: @"1",@"2",nil];
    
    //    5、arrayWithObjects:count:  取一个数组里面的几个元素   同9
    //    id a[3] = {@"1",@"2",@"3"};
    //    NSArray *a1 = [NSArray arrayWithObjects:a count:2];
    //    NSLog(@"%@",a1);
    
    //    6、init
    //    NSArray *a1 = [[NSArray alloc]init];
    
    //    7、initWithArray:   用数组初始化另外一个数组
    //    NSArray *a1 = [[NSArray alloc]init];
    //    NSArray *a2 = [[NSArray alloc]initWithArray:a1];
    
    //    8、initWithObjects:
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2" ,nil];
    
    //    9、initWithObjects:count:   取一个数组里面的几个元素   同5
    //    id a[3] = {@"1",@"2",@"3"};
    //    NSArray *a1 = [[NSArray alloc] initWithObjects:a count:2];
    //    NSLog(@"%@",a1);
    
    //    10、containsObject://  数组中是否包含某元素
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    int bo  = [a1 containsObject:@"1"];
    
    //    11、count   计算数组的元素个数
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    int long a = [a1 count];
    //    NSLog(@"%ld",a);
    
    //    12、getObjects:range:      去一个范围内的元素存储到一个数组中
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    id a [10] ;
    //    [a1 getObjects:a range:NSMakeRange(0, 3)];
    //    NSLog(@"%@",a[2]);
    
    //    13、firstObject  第一个元素  (wu)
    
    //    14、lastObject   z最后一个元素
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    NSArray *a2 =  [a1 lastObject];
    //    NSLog(@"%@",a2);
    
    //    15、objectAtIndex:    指定下表元素]
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    NSLog(@"%@",[a1 objectAtIndex:1]);
    
    //    16、objectsAtIndexes:   不懂
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    NSIndexSet *indexset = [NSIndexSet indexSetWithIndex:0];
    //    NSArray *a2 = [a1 objectsAtIndexes:indexset];
    //    NSLog(@"%@",a2);
    
    //    17、objectEnumerator    枚举
    
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    NSEnumerator *enu = [a1 objectEnumerator];
    //
    //    id obj;
    //    while (obj = [enu nextObject]) {
    //        NSLog(@"obj:%@",obj);
    //    }
    
    
    //    18、reverseObjectEnumerator    反向枚举
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    NSEnumerator *enu = [a1 reverseObjectEnumerator];
    
    //    19、indexOfObject:  //返回指定元素的下标
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    NSLog(@"%lu",(unsigned long)[a1 indexOfObject:@"1"]);
    
    //    20、indexOfObject:inRange:///在一个范围内找指定元素的下标
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    ;
    //    NSLog(@"%ld",[a1 indexOfObject:@"1" inRange:NSMakeRange(1, 3)]);
    
    //    21、makeObjectsPerformSelector:通过某方法对数组排序
    //    NSArray *arr = [NSArray arrayWithObjects:@"3",@"2",@"1", nil];
    //
    //    [arr makeObjectsPerformSelector:<#(SEL)#>];
    
    
    //    22、makeObjectsPerformSelector:withObject:
    
    //    23、firstObjectCommonWithArray:   返回另外一个数组与当前数组第一个相同的元素
    //    NSArray *a1 = [[NSArray alloc]initWithObjects:@"1",@"2",@"3",nil];
    //    NSArray *arr = [NSArray arrayWithObjects:@"2",@"2",@"1", nil];
    //    ;
    //    NSLog(@"%@",[arr firstObjectCommonWithArray:a1]);
    
    //    24、isEqualToArray:   比较两个数组  返回bool值
    
    
    //    NSMutableString
    
    //    25、arrayByAddingObject:   给一个数组增加一个元素
    //    NSMutableArray *a1= [NSMutableArray arrayWithObjects:@"1",@"2",@"3", nil];
    //    NSArray *a2 = [a1 arrayByAddingObject:@"4"];
    //    NSLog(@"%@",a2);
    
    //    26、arrayByAddingObjectsFromArray:  从另外一个数组增加元素
    //    NSArray *a1= [NSArray arrayWithObjects:@"1",@"2",@"3", nil];
    //    NSArray *a2= [NSArray arrayWithObjects:@"4", nil];
    //    NSArray *a3 = [a1 arrayByAddingObjectsFromArray:a2];
    //    NSLog(@"%@",a3);
    
    //    27、sortedArrayUsingFunction:context:  按照某个方法来进行排序
    //    NSArray *a = [NSArray arrayWithObjects:@"Apple",@"IBM",@"Microsoft", nil];
    //    NSArray *orderArray = [a sortedArrayUsingFunction:NSOrderedAscending context:NULL];
    //    NSLog(@"%@",orderArray);
    
    //    28、sortedArrayUsingDescriptors:   这里的NSArray中的第一元素表示首先按照这个元素的升序或者降序进行排序,对于有重复项的,再按照第二元素进行排序,依次进行类推
    //    NSDictionary *_dic1=[NSDictionary dictionaryWithObjectsAndKeys:@"2030",@"year", @"1",@"month",nil];
    //    NSDictionary *_dic2=[NSDictionary dictionaryWithObjectsAndKeys:@"2010",@"year", @"2",@"month", nil];
    //    NSDictionary *_dic3=[NSDictionary dictionaryWithObjectsAndKeys:@"2050",@"year", @"3",@"month" ,nil];
    //    NSDictionary *_dic4=[NSDictionary dictionaryWithObjectsAndKeys:@"2014",@"year",  @"4",@"month",nil];
    //    NSDictionary *_dic5=[NSDictionary dictionaryWithObjectsAndKeys:@"2050",@"year",  @"4",@"month",nil];
    //    NSArray *_array=[NSArray arrayWithObjects:_dic1,_dic2,_dic3,_dic4,_dic5, nil];
    //
    //    NSSortDescriptor *descripor=[NSSortDescriptor sortDescriptorWithKey:@"year" ascending:NO];
    //
    //    NSSortDescriptor *descripor2=[NSSortDescriptor sortDescriptorWithKey:@"month" ascending:NO];
    //
    //    [_array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descripor,descripor2,nil]];
    //
    //    NSLog(@"%@",[_array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descripor,descripor2,nil]]);
    
    //    29、sortedArrayUsingSelector:   按照某方法来进行排序
    
    
    //    30、componentsJoinedByString:   用某个字符连接成一个字符串  拼接
    //    NSArray *a1= [NSArray arrayWithObjects:@"1",@"2",@"3", nil];
    //    NSString *a2 = [a1 componentsJoinedByString:@"-"];
    //    NSLog(@"%@",a2);
    //
    //    31、arrayWithCapacity:   便利构造器初始化数组
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    
    //    32、initWithCapacity:   alloc初始化可变数组
    //    NSMutableArray *arr1 = [[NSMutableArray alloc]initWithCapacity:4];
    
    //    33、addObject:增加一个对象
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    [arr addObject:@"5"];
    
    //    34、addObjectsFromArray:   从一个数组中增加对象  即增加后面的数组
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    NSMutableArray *arr2 = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    [arr addObjectsFromArray:arr2];
    
    //    35、insertObject:atIndex:    在索引值插入元素
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    [arr insertObject:@"5" atIndex:2];
    
    //    36、removeAllObjects   删除所有的元素
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    [arr removeAllObjects];
    
    //    37、removeLastObject   删除最后一个元素
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    [arr removeLastObject];
    
    //    38、removeObject:      删除与后面相同的元素
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    [arr removeObject:@"4"];
    
        39、removeObject:inRange:     删除指定范围的 元素
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    [arr removeObject:@"2" inRange:NSMakeRange(0, 4)];
    
    //    40、removeObjectAtIndex:     删除指定下标的元素
    //    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",@"4", nil];
    //    [arr removeObjectAtIndex:3];
    
    //    41、removeObjectsInArray:    删除一个在其他数组中的对象
    //    NSMutableArray *a1 = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",nil];
    //    NSMutableArray *a2 = [NSMutableArray arrayWithObjects:@"1",nil];
    //    [a1 removeObjectsInArray:a2];
    //    NSLog(@"%@",a1);
    
    //    42、removeObjectsInRange:在某个范围内删除对象
    //    NSMutableArray *a2 = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",nil];
    //    [a2 removeObjectsInRange:NSMakeRange(0, 1)];
    
    //    43、replaceObjectAtIndex:withObject:  下标为几 的用后面的元素取代
    //    NSMutableArray *a2 = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",nil];
    //    [a2 replaceObjectAtIndex:2 withObject:@"4"];
    
    //    44、setArray:   重置一个数组
    //     NSMutableArray *a1 = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",nil];
    //    NSMutableArray *a2 = [[NSMutableArray alloc]init];
    //    [a1 setArray:a2];
    //
    
    //    45、exchangeObjectAtIndex:withObjectAtIndex:  交换两小\标的元素
    //    NSMutableArray *a2 = [NSMutableArray arrayWithObjects:@"1",@"2",@"3",nil];
    //    [a2 exchangeObjectAtIndex:2 withObjectAtIndex:3];
    
    //    46、sortUsingDescriptors:
    //    NSMutableArray
    //    47、sortUsingFunction:context:
    //    48、sortUsingSelector:
    
    
    
    
    //字典
    
    //    1、dictionary
    //    NSDictionary *d = [NSDictionary dictionary];
    
    //    2、dictionaryWithDictionary:
    //    NSDictionary *d1 = [NSDictionary dictionary];
    //    NSDictionary *d = [NSDictionary dictionaryWithDictionary:d1];
    
    //    3、dictionaryWithObject:forKey:
    //    NSDictionary *d = [NSDictionary dictionaryWithObject:@"tzs" forKey:@"name"];
    
    //    4、dictionaryWithObjects:forKeys:
    //    NSArray *value = @[@"tzs",@"m",@"24"];
    //    NSArray *key = @[@"na me",@"sex",@"age"];
    //    NSDictionary *d1 = [NSDictionary dictionaryWithObjects:value forKeys:key];
    
    //    5、dictionaryWithObjectsAndKeys:   算是比较常用
    //    NSDictionary *d3 = [NSDictionary dictionaryWithObjectsAndKeys:@"xiaobao",@"name",@"m",@"sex", nil];
    
    //    6、initWithDictionary:
    //    NSDictionary *d3 = [NSDictionary dictionaryWithObjectsAndKeys:@"xiaobao",@"name",@"m",@"sex", nil];
    //    NSDictionary *d4 = [[NSDictionary alloc] initWithDictionary:d3];
    
    //    7、initWithObjects:forKeys:
    //    NSArray *value = @[@"tzs",@"m",@"24"];
    //    NSArray *key = @[@"na me",@"sex",@"age"];
    //
    //    NSDictionary *d = [[NSDictionary alloc]initWithObjects:value forKeys:key];
    
    //    8、initWithObjectsAndKeys:
    //    NSDictionary *d = [[NSDictionary alloc] initWithObjectsAndKeys:@"name",@"age",@"sex", nil];
    
    //    9、count
    //    NSDictionary *d3 = [NSDictionary dictionaryWithObjectsAndKeys:@"xiaobao",@"name",@"m",@"sex", nil];
    //    NSLog(@"%ld",[d3 count]);
    
    //    10、isEqualToDictionary:
    //    NSDictionary *d3 = [NSDictionary dictionaryWithObjectsAndKeys:@"xiaobao",@"name",@"m",@"sex", nil];
    //    NSArray *value = @[@"tzs",@"m",@"24"];
    //    NSArray *key = @[@"na me",@"sex",@"age"];
    //    NSDictionary *d1 = [NSDictionary dictionaryWithObjects:value forKeys:key];
    //    int a = [d1 isEqualToDictionary:d3];
    
    //    11、allKeys  打印所有的键
    //    12、allKeysForObject: 打印某个值对应的所有的键  返回值为数组
    //    13、allValues  返回所有的 值
    //    14、objectForKey:   查找key  对应的 value
    //    NSArray *value = @[@"tzs",@"m",@"24"];
    //    NSArray *key = @[@"name",@"sex",@"age"];
    //    NSDictionary *d1 = [NSDictionary dictionaryWithObjects:value forKeys:key];
    //    NSLog(@"%@" ,[d1 objectForKey:@"name"]);
    
    //    15、valueForKey:同  14  只不过
    
    //    16、keyEnumerator
    //    NSDictionary *d = [NSDictionary dictionaryWithObject:@"tzs" forKey:@"name"];
    //    NSEnumerator *e = [d  keyEnumerator];
    //    id obj;
    //    while (obj = [e nextObject]) {
    //        NSLog(@"obj:%@",obj);
    //    }
    
    
    //    17、objectEnumerator
    //    NSDictionary *d = [NSDictionary dictionaryWithObject:@"tzs" forKey:@"name"];
    //    NSEnumerator *e = [d  objectEnumerator];
    //    id obj;
    //    while (obj = [e nextObject]) {
    //        NSLog(@"obj:%@",obj);
    //    }
    
    //    18、keysSortedByValueUsingSelector:  通过某个方法对字典的key排序
    
    
    //    可变字典
    
    //    19、dictionaryWithCapacity:初始化
    //    NSMutableDictionary *d = [NSMutableDictionary dictionaryWithCapacity:3];
    
    //    20、initWithCapacity:
    //    NSMutableDictionary *d = [[NSMutableDictionary alloc]initWithCapacity:3];
    //    21、init
    //    22、setObject:forKey:
    //    NSMutableDictionary *d = [[NSMutableDictionary alloc]initWithCapacity:3];
    //   [d setObject:@"tzs" forKey:@"name"];
    //    NSLog(@"%@",d);
    
    //    23、setValue:forKey:
    
    //    24、setDictionary:
    //    NSMutableDictionary *d = [[NSMutableDictionary alloc]initWithCapacity:3];
    //    NSMutableDictionary *d2 = nil ;
    //    [d2 setDictionary:d];
    
    //    25、removeObjectForKey:
    //    NSArray *value = @[@"tzs",@"m",@"24"];
    //    NSArray *key = @[@"name",@"sex",@"age"];
    //
    //    NSMutableDictionary *d = [NSMutableDictionary dictionaryWithObjects:value forKeys:key];
    //    [d removeObjectForKey:@"name"];
    
    //    26、removeAllObjects
    //    27、removeObjectsForKeys:
    //    NSArray *value = @[@"tzs",@"m",@"24"];
    //    NSArray *key = @[@"name",@"sex",@"age"];
    //
    //    NSMutableDictionary *d = [NSMutableDictionary dictionaryWithObjects:value forKeys:key];
    //    NSArray *a = @[@"name",@"sex"];
    //    [d removeObjectsForKeys:a];
    //    NSLog(@"%@",d);
    //
    //
    //
    //    1、set
    //    2、setWithArray:
    //    NSArray *a = @[@"1",@"2"];
    //    NSSet *s = [NSSet setWithArray:a];
    //    NSLog(@"%@",s);
    
    //    3、setWithObject:
    
    //    NSSet *s = [NSSet setWithObject:@"1"];
    
    //    4、setWithObjects:
    //    NSSet *s = [NSSet setWithObjects:@"1",@"2",@"3", nil];
    
    //    5、setWithSet:   用另外一个初始化
    
    //    6、setByAddingObject:增加
    //    NSSet *s = [NSSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSSet *s1 = [s setByAddingObject:@"4"];
    
    //    7、setByAddingObjectsFromSet:
    //    NSSet *s = [NSSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSSet *s1 = [NSSet setWithObject:@"4", nil];
    //    NSSet *s2 = [s setByAddingObjectsFromSet:s1];
    //    8、setByAddingObjectsFromArray:  增加一个数组的元素到集合
    //    9、count
    //     NSSet *s = [NSSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSLog(@"%ld",[s count]);
    //    10、allObjects
    //    NSSet *s = [NSSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSLog(@"%@",[s allObjects]);
    //    11、anyObject   随机取一个元素
    //    12、containsObject:
    //    13、member:    查找是否有相同元素  有则返回 灭有返回空
    //    NSSet *s = [NSSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSLog(@"%@",[s member:@"3"]);
    //    14、objectEnumerator   枚举u
    //    NSSet *s = [NSSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSEnumerator *en = [s objectEnumerator];
    //    id obj ;
    //    while (obj = [en nextObject]) {
    //        NSLog(@"s = %@",obj);
    //    }
    //    15、isSubsetOfSet:   判断是否有子集
    //    16、intersectsSet:   判断是否有交集
    //    17、isEqualToSet:    判断是否相同
    //
    //
    //    可变集合
    //
    //    18、addObject:       增加一个元素
    //    19、removeObject:     删减一个元素
    //    20、removeAllObjects   删除所有元素
    //    21、addObjectsFromArray:   从数组中增加元素
    //    22、unionSet:    合并两个集合
    //    NSMutableSet *s = [NSMutableSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSMutableSet *s2 = [NSMutableSet setWithObjects:@"4",@"2",@"5", nil];
    //    [s unionSet:s2];
    //    NSLog(@"%@",s);
    
    //    23、minusSet:     减去相同元素的集合
    //    NSMutableSet *s = [NSMutableSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSMutableSet *s2 = [NSMutableSet setWithObjects:@"4",@"2",@"5", nil];
    //    [s minusSet:s2];
    //    NSLog(@"%@",s);
    
    //    24、intersectSet:   两个集合 的交集
    //    NSMutableSet *s = [NSMutableSet setWithObjects:@"1",@"2",@"3", nil];
    //    NSMutableSet *s2 = [NSMutableSet setWithObjects:@"4",@"2",@"5", nil];
    //    [s intersectSet:s2];
    //    NSLog(@"%@",s);
    
    //    25、setSet:用一个集合重置一个集合
    //  
    
    
    //    26、countForObject:
    //    NSCountedSet *s = [NSCountedSet setWithObjects:@"1",@"2",@"1",nil];
    //    NSLog(@"%ld",[s countForObject:@"1"]);
    

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在现有省、市港口信息化系统进行有效整合基础上,借鉴新 一代的感知-传输-应用技术体系,实现对码头、船舶、货物、重 大危险源、危险货物装卸过程、航管航运等管理要素的全面感知、 有效传输和按需定制服务,为行政管理人员和相关单位及人员提 供高效的管理辅助,并为公众提供便捷、实时的水运信息服务。 建立信息整合、交换和共享机制,建立健全信息化管理支撑 体系,以及相关标准规范和安全保障体系;按照“绿色循环低碳” 交通的要求,搭建高效、弹性、高可扩展性的基于虚拟技术的信 息基础设施,支撑信息平台低成本运行,实现电子政务建设和服务模式的转变。 实现以感知港口、感知船舶、感知货物为手段,以港航智能 分析、科学决策、高效服务为目的和核心理念,构建“智慧港口”的发展体系。 结合“智慧港口”相关业务工作特点及信息化现状的实际情况,本项目具体建设目标为: 一张图(即GIS 地理信息服务平台) 在建设岸线、港口、港区、码头、泊位等港口主要基础资源图层上,建设GIS 地理信息服务平台,在此基础上依次接入和叠加规划建设、经营、安全、航管等相关业务应用专题数据,并叠 加动态数据,如 AIS/GPS/移动平台数据,逐步建成航运管理处 "一张图"。系统支持扩展框架,方便未来更多应用资源的逐步整合。 现场执法监管系统 基于港口(航管)执法基地建设规划,依托统一的执法区域 管理和数字化监控平台,通过加强对辖区内的监控,结合移动平 台,形成完整的多维路径和信息追踪,真正做到问题能发现、事态能控制、突发问题能解决。 运行监测和辅助决策系统 对区域港口与航运业务日常所需填报及监测的数据经过科 学归纳及分析,采用统一平台,消除重复的填报数据,进行企业 输入和自动录入,并进行系统智能判断,避免填入错误的数据, 输入的数据经过智能组合,自动生成各业务部门所需的数据报 表,包括字段、格式,都可以根据需要进行定制,同时满足扩展 性需要,当有新的业务监测数据表需要产生时,系统将分析新的 需求,将所需字段融合进入日常监测和决策辅助平台的统一平台,并生成新的所需业务数据监测及决策表。 综合指挥调度系统 建设以港航应急指挥心为枢纽,以各级管理部门和经营港 口企业为节点,快速调度、信息共享的通信网络,满足应急处置所需要的信息采集、指挥调度和过程监控等通信保障任务。 设计思路 根据项目的建设目标和“智慧港口”信息化平台的总体框架、 设计思路、建设内容及保障措施,围绕业务协同、信息共享,充 分考虑各航运(港政)管理处内部管理的需求,平台采用“全面 整合、重点补充、突出共享、逐步完善”策略,加强重点区域或 运输通道交通基础设施、运载装备、运行环境的监测监控,完善 运行协调、应急处置通信手段,促进跨区域、跨部门信息共享和业务协同。 以“统筹协调、综合监管”为目标,以提供综合、动态、实 时、准确、实用的安全畅通和应急数据共享为核心,围绕“保畅通、抓安全、促应急"等实际需求来建设智慧港口信息化平台。 系统充分整合和利用航运管理处现有相关信息资源,以地理 信息技术、网络视频技术、互联网技术、移动通信技术、云计算 技术为支撑,结合航运管理处专网与行业数据交换平台,构建航 运管理处与各部门之间智慧、畅通、安全、高效、绿色低碳的智 慧港口信息化平台。 系统充分考虑航运管理处安全法规及安全职责今后的变化 与发展趋势,应用目前主流的、成熟的应用技术,内联外引,优势互补,使系统建设具备良好的开放性、扩展性、可维护性。
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值