の呼び出しに問題がありreloadData
ます。2 つのクラスがあり、テーブルを更新できません。
私のrootViewController.m
:
[self presentModalViewController:firstV animated:NO];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyCellIdentifier = @"MyCellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyCellIdentifier];
if(cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:MyCellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleGray;
//cell.textLabel.text = @"dupa";
//cell.textLabel.font = [ UIFont fontWithName: @"Arial" size: 50.0 ];
}
NSLog(@"xxx ===== %@",firstVC.xxx);
UIImageView *imgView = [[UIImageView alloc]init];
UILabel *rankLabel = [[UILabel alloc]init];
UILabel *rankDetail = [[UILabel alloc]init];
UILabel *cyclesLabel = [[UILabel alloc]init];
UILabel *cyclesDetail = [[UILabel alloc]init];
UILabel *approxLabel = [[UILabel alloc]init];
UILabel *approxDetail = [[UILabel alloc]init];
UILabel *leftP = [[UILabel alloc]init];
UILabel *rightP = [[UILabel alloc]init];
UILabel *leftQ = [[UILabel alloc]init];
UILabel *rightQ = [[UILabel alloc]init];
UILabel *timeLabel = [[UILabel alloc]init];
UILabel *timeDetail = [[UILabel alloc]init];
UILabel *freeProductLabel = [[UILabel alloc]init];
UILabel *freeDetailLabel = [[UILabel alloc]init];
NSString *approxString;
NSString *leftPeqsString;
NSString *rightPeqsString;
NSString *leftQString;
NSString *rightQString;
switch (indexPath.row) {
case 0:
imgView.frame = CGRectMake(10.0, 15.0, 80.0, 80.0);
imgView.image = [UIImage imageNamed:@"Ambassador@2x.jpeg"];
imgView.layer.cornerRadius = 40;
imgView.layer.masksToBounds = YES;
//imgView.contentMode = UIViewContentModeScaleAspectFit;
//cell.imageView.image = imgView.image;
[cell.contentView addSubview:imgView];
rankLabel.frame = CGRectMake(110.0, 45.0, 200.0, 50.0);
rankLabel.text = firstVC.xxx;
rankLabel.textColor = [UIColor orangeColor];
rankLabel.font = [UIFont boldSystemFontOfSize:28];
[cell.contentView addSubview:rankLabel];
rankDetail.text = @"Your current rank:";
rankDetail.frame = CGRectMake(110.0, 30.0, 200.0, 30.0);
rankDetail.font = [UIFont boldSystemFontOfSize:16];
[cell.contentView addSubview:rankDetail];
//cell.textLabel.font = [UIFont systemFontOfSize:20];
//cell.textLabel.textColor = [UIColor orangeColor];
break;...`
および: myFirstViewController.m
:
- (void)date:(NSString*)data
{
ViewController *viewC = [[ViewController alloc]init];
xxx = rank;
NSLog(@"FVC rank xxx ==== %@", xxx);
[viewC.tableView reloadData];
}
テーブルを更新できないのはなぜですか?