0

这是我的代码

NSInteger selectedRow = selectedStationPath.row;
            UITableViewCell *cellz = [tabView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:selectedRow inSection:0]];
            UIColor *color = [[UIColor alloc] initWithRed:0.0 green:0.5 blue:1.0 alpha:0.2];
            cellz.contentView.backgroundColor=color;
            NSLog([NSString stringWithFormat:@"%i",selectedRow]);

selectedStationPath是一个全球性的NSIndexPath......如果我输入一个数字而不是selectedRow它的indexPathForRow作品。NSLog 打印selectedRow正确,但是当我selectedRow输入时indexPathForRow,即使 NSLog 正在打印selectedRow...

4

0 回答 0