これが私のコードです
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
...