六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 39|回复: 0

objective-c对NSArray的学习

[复制链接]

升级  51.33%

35

主题

35

主题

35

主题

秀才

Rank: 2

积分
127
 楼主| 发表于 2013-1-26 13:06:50 | 显示全部楼层 |阅读模式
<span style="color: #555555; font-family: Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif; line-height: 17px;">NSARRAY简单的使用
定义数组,遍历数组:

<div class="wp_syntax" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px !important; padding-left: 0px; width: 600px; background-color: #f7f7f7; border: 1px solid #cccccc;">
12345678    NSArray *array;    array = [NSArray arrayWithObjects:@"one", @"two", @"three", @"four",nil];     int i;    for(i = 0; i < [array count]; i++)    {        NSLog(@"index %d has %@.",i,[array objectAtIndex:i]);    }
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表