这是我的didselectrowatindexpath方法:
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView==self.tableView1) {
UITableViewCell * Cell = [self.tableView cellForRowAtIndexPath:indexPath];
[self.btnoutlet1 setTitle:Cell.textLabel.text forState:UIControlStateNormal];
self.tableView1.hidden = YES;
_projdict = [[NSMutableDictionary alloc] init];
[_projdict setObject:[self.itemArray objectAtIndex:indexPath.row] forKey:@"beta"];
NSLog(@" %@",_projdict);
_projid = [[_projdict objectForKey:@"beta"] objectForKey:@"id"];
NSLog(@ " %@" , _projid);
}
}
从此我得到projid为'x'。
然后我想执行这个方法,值必须通过这个。
- (void) issuedetais {
NSLog(@ " %@" , _projid);
NSString * project_id1 =[NSStringstringWithFormat:@"Project_id=%@",projid];
NSLog(@"%@",project_id1);
NSString * u1 =@“xxx/issues.json?";
NSString * u2 = [NSString stringWithFormat:@"%@%@",u1,project_id1];
NSLog(@"%@",u2);
}
我想要这样的网址:
u2=xxx/issues.json?Project_id=8
在viewdidload中,我这样调用:
- (void) viewdidload {
[self projectdetails];
[self issuedetails];
[self activitydetails];
[self Toformjsondata];
}
或者如何进行方法执行的层次结构。或者其他任何方式来执行此操作?还有其他替代方法吗?