Objective c 访问数组中的对象?

Objective c 访问数组中的对象?,objective-c,arrays,nsstring,Objective C,Arrays,Nsstring,我的阵列设置如下: NSMutableArray *array = [[NSArray alloc] initWithObjects: @"Item 1", @"Item 2", @"Item 3", @"Item 4", @"Item 5", nil]; 我想访问数组的内容,以NSString形式显示它们,但我不确定使用什么,例如: [NSString stringWithFormat:@"%c", [objectAtIndex:0]]; [NSString stringWithFormat

我的阵列设置如下:

NSMutableArray *array = [[NSArray alloc] initWithObjects: @"Item 1", @"Item 2", @"Item 3", @"Item 4", @"Item 5", nil];
我想访问数组的内容,以NSString形式显示它们,但我不确定使用什么,例如:

[NSString stringWithFormat:@"%c", [objectAtIndex:0]];
[NSString stringWithFormat:@"%c", [objectAtIndex:1]];

但是我的数组是在
-(void)viewDidLoad
中声明的,我需要在
-(UITableViewCell*)tableView:(UITableView*)atatableview cell for rowatindexpath:(nsindepath*)indepath
中访问它们,并将它们显示在NSString中?如何将数组作为实例变量。然后,您可以从任何实例方法访问它。

您必须使
数组
成为一个实例变量。请参阅,第二部分是什么?[NSString stringWithFormat:%@,[objectAtIndex:1];访问每个对象是否正确?抱歉,忘记回答第二部分:将%@格式与[array objectAtIndex:idx]一起使用。