如何改变ios中委托方法的执行?

时间:2016-01-20 07:48:57

标签: ios objective-c uitableview

这是我的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];
}
  1. 在运行时,首先执行方法问题详细信息,以便projid为空。
  2. 而不是那个didselectrowatindexpath首先执行我将获得projid。
  3. 我想执行方法的层次结构会是这样的
    1. 无效项目详情
    2. didSelectRowAtIndexPath方法
    3. issuedetails。
  4. 或者如何进行方法执行的层次结构。或者其他任何方式来执行此操作?还有其他替代方法吗?

0 个答案:

没有答案