【发布时间】:2012-04-08 17:32:16
【问题描述】:
作为一个例子,如果我有这个数组:
_mode = [NSArray arrayWithObjects:
[NSArray arrayWithObjects:@"1", @"One", nil],
[NSArray arrayWithObjects:@"2", @"Two", nil],
[NSArray arrayWithObjects:@"3", @"Three", nil],
[NSArray arrayWithObjects:@"4", @"Four", nil],
[NSArray arrayWithObjects:@"5", @"Five", nil],
nil];
我需要找到数组 _mode 的哪个对象包含 @"3" 我该怎么做?
我试过selectedIndex = [_mode indexOfObject:@"3"]; 和selectedIndex = [[_mode objectAtIndex:0] indexOfObject:@"sta"];,但都不管用。
【问题讨论】:
标签: objective-c xcode cocoa-touch nsarray