码迷,mamicode.com
首页 > 其他好文 > 详细

NSArray 介绍

时间:2014-12-18 19:11:17      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:ios   nsarray   nsmutablearray   

NSArray *array = [NSArray arrayWithObjects:@"1",@"2",@"3",nil];

    [array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {

        NSLog(@"%zi->%@",idx, obj);

    }];


    NSMutableString *string1 = [NSMutableString stringWithString:@"A"];

    NSMutableString *string2 = [NSMutableString stringWithString:@"B"];

    NSMutableString *string3 = [NSMutableString stringWithString:@"C"];

    

    NSArray *listOfObjects = [NSArray arrayWithObjects:string1, string2,string3, nil];

    

    for(NSMutableString *s in listOfObjects){

        NSLog(@"This string in lowercase is %@", [s lowercaseString]);

        

    }

    

    [listOfObjects makeObjectsPerformSelector:@selector(appendString:)withObject:@"-MORE"];


本文出自 “深圳市联城通科技公司” 博客,谢绝转载!

NSArray 介绍

标签:ios   nsarray   nsmutablearray   

原文地址:http://roderickkennedy.blog.51cto.com/6758427/1591377

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!