我的代码如下:
NSArray *vis = [tableView1 visibleCells];
NSLog (@"vis %@", vis);
我得到:
2012-07-04 21:16:44.564 xxx[1933:12e03] vis (
"<UITableViewCell: 0xb2dcc80; frame = (0 0; 320 80); text = 'xxx1'; autoresize = W; layer = <CALayer: 0xb2dcd60>>",
"<UITableViewCell: 0x635ea10; frame = (0 80; 320 80); text = 'xxx2'; autoresize = W; layer = <CALayer: 0x6353620>>",
"<UITableViewCell: 0xb2ddca0; frame = (0 160; 320 80); text = 'xxx3'; autoresize = W; layer = <CALayer: 0xb2ddc70>>",
"<UITableViewCell: 0x635f7d0; frame = (0 240; 320 80); text = 'xxx4'; autoresize = W; layer = <CALayer: 0x635f650>>"
当我写:
NSString *aText = [vis objectAtIndex:0];
NSLog (@"aText %@", aText);
我总是收到警告:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array'
这是一种多维数组吗?如果是,我怎样才能只提取文本?