0
我有一個NSString
在.h文件中聲明。然後我在ViewDidload
內分配一個值。在我的didSelectRowatIndex
事件中想要將該值賦給先前ViewController中的另一個字符串。無法訪問viewdidload之外的NSString
.H
`
NSString *strWifiId;
NSArray *arrstrWifiId;`
`
- (無效)viewDidLoad中 {
arrstrWifiId=[arrWorkflow valueForKey:@"WFID"];
strWifiId=[NSString stringWithFormat:@"%@",[arrstrWifiId objectAtIndex:0] ];
}
`
`
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSArray *array = [self.navigationController viewControllers];
NSLog(@"navi array count ----- %d",[array count]);
UITableViewCell *selectedCell=[tableView cellForRowAtIndexPath:indexPath];
for (UIViewController* viewController in self.navigationController.viewControllers) {
if ([viewController isKindOfClass:[SendTimeChangeRequestViewController class]]) {
SendTimeChangeRequestViewController *groupViewController = (SendTimeChangeRequestViewController*)viewController;
[groupViewController.btnwrkflwFirstApprove setTitle:selectedCell.textLabel.text forState:UIControlStateNormal];
groupViewController.pWorkFlowID=strWifiId;
NSLog(@"WFID---- %@",groupViewController.pWorkFlowID);
//NSLog(@"CELL TAG----- %@",groupViewController.pAuthEmployeeCode);
[self.navigationController popToViewController:groupViewController animated:YES];
}
}
`
這裏NSLog
打印一些垃圾值。爲什麼是這個?我該如何解決這個問題?
感謝