首先,我是一位新的iOS开发者。
我有2个UITableView。
我创建了转到第二个UITableView的按钮
如果点击按钮。连接器将获得@" special_selected_f10"处理requestEWIServiceFinish方法。
- (IBAction)btnf10
{
NSMutableDictionary *content = [NSMutableDictionary dictionary];
[content setValue:[[AppSetting sharedInstance] token] forKey:@"ewitoken"];
];
[[EWIConnector connector] requestEWIService:@"special_selected_f10" requestData:content delegate:self];
}
如果有@" special_selected_f10"从下面的代码。它将跟随标识符名称转到第二个UITableView和响应数据。
- (void) requestEWIServiceStart:(EWIConnector *)connector{
NSLog(@"start %@",connector.endpoint);
}
- (void) requestEWIServiceFinish:(EWIConnector *)connector responseData:(NSDictionary *)responseData{
NSLog(@"finish %@",connector.serviceName);
NSLog(@"response %@",responseData);
if ([connector.serviceName isEqualToString:@"special_selected_f10"])
{
NSLog(@"finish %@", connector.serviceName);
NSDictionary *content = responseData[@"content"];
NSString *stAlertMes = [content objectForKey:@"alertMessage"];
stAlertMes = [self getString:stAlertMes];
NSLog(@"AlertMSG : %@", stAlertMes);
if (![stAlertMes isEqualToString:@""])
{
NSLog(@"ALERT MESSAGE : %@", stAlertMes);
gloablOnWherehouse.arTableDataSelected = [[NSArray alloc] init];
}
else
{
NSLog(@"HAS DATA");
gloablOnWherehouse.arTableDataSelected = [content objectForKey:@"DataList_SPI_DetailF10Collection"];
[self performSegueWithIdentifier:@"gotoF10" sender:nil];
//labelStatus.text = @"";
}
}
else
{
NSLog(@"response %@",responseData);
}
}
这是来自第二个UITableView的响应数据代码。
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"DisplayEffectQtyViewCell";
DisplayEffectQtyViewCell *cell = [self.tableViewDetailList dequeueReusableCellWithIdentifier:simpleTableIdentifier forIndexPath:indexPath];
if(cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"DisplayEffectQtyViewCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
} else {
if (globlOnDisplayEffect.arTableDataSelected) {
NSMutableArray *myMutbleArray = [[NSMutableArray alloc] init];
[myMutbleArray addObject:globlOnDisplayEffect.arTableDataSelected];
if (myMutbleArray)
{
NSDictionary *myDic = [globlOnDisplayEffect.arTableDataSelected objectAtIndex:indexPath.row];
NSDictionary *cont = [myDic objectForKey:@"DataList_SPI_DetailF10"];
NSString *f10_cmpt = [self getString:[cont objectForKey:@"f10_cmpt"]];
NSString *f10_dt = [self getString:[cont objectForKey:@"f10_dt"]];
NSString *f10_item = [self getString:[cont objectForKey:@"f10_item"]];
NSString *f10_lot = [self getString:[cont objectForKey:@"f10_lot"]];
NSString *f10_model = [self getString:[cont objectForKey:@"f10_model"]];
NSString *f10_of = [self getString:[cont objectForKey:@"f10_of"]];
NSString *f10_semi = [self getString:[cont objectForKey:@"f10_semi"]];
NSString *f10_tm = [self getString:[cont objectForKey:@"f10_tm"]];
NSString *f10_uncmp = [self getString:[cont objectForKey:@"f10_uncmp"]];
[cell setf10_cmpt:f10_cmpt setf10_dt:f10_dt setf10_item:f10_item setf10_lot:f10_lot setf10_model:f10_model setf10_of:f10_of setf10_semi:f10_semi setf10_tm:f10_tm setf10_uncmp:f10_uncmp];
}
}
}
return cell;
}
从上面开始是我的应用程序的概念。
但是,当我点击按钮时。 从调试IBAction不采取@" special_selected_f10"检查" requestEWIServiceFinish"方法。 它转到第二个UITableView并响应空数据。在回到第一个UITableView并再次遵循我的概念之前。
因此,当我点击按钮时,我的应用程序有2秒UITableView。 (清空第二个UITableView并运行第二个UITableView)
我可以说一点英语。 抱歉我的英语不好。