在 myDetailViewController.m
中,该rowNumber
值运行良好。但是当值不能应用到viewDidLoad
时rowNumber
是零。我怎么解决这个问题?
//DetailViewController.m
-(void)updateRowNumber:(int)theindex
{
rowNumber = theindex + 1;
message.text = [NSString stringWithFormat:@"row %d was clicked", rowNumber];
NSLog(@"ID #000%d", rowNumber);
}
-(void)viewDidLoad
{
message.text = [NSString stringWithFormat:@"row %d was clicked", rowNumber];
}