Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/106.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 通过展开返回的值为;空";_Ios_Objective C - Fatal编程技术网

Ios 通过展开返回的值为;空";

Ios 通过展开返回的值为;空";,ios,objective-c,Ios,Objective C,我尝试在另一个视图中使用unwind方法返回行(来自表)的值 但是第一个viewController中的值catch为null 这是FirstViewController中的代码 - (IBAction)retrievePremadeMessage:(UIStoryboardSegue *)segue;(h) - (IBAction)retrievePremadeMessage:(UIStoryboardSegue *)segue { PreStoredMessagesTableViewCont

我尝试在另一个视图中使用unwind方法返回行(来自表)的值 但是第一个viewController中的值catch为null

这是FirstViewController中的代码

- (IBAction)retrievePremadeMessage:(UIStoryboardSegue *)segue;(h)
- (IBAction)retrievePremadeMessage:(UIStoryboardSegue *)segue
{
PreStoredMessagesTableViewController *cc = segue.sourceViewController;
self.textViewMsg = [[UITextView alloc] init];
self.textViewMsg.text = cc.valeurCell;
NSLog(@"cell selected: %@", cc.valeurCell);
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

// Retrieve the value of cell selected
self.valeurCell = [NSString stringWithFormat:@"%@", [tableView cellForRowAtIndexPath:indexPath].textLabel.text];
}
这是第二个视图控制器

- (IBAction)retrievePremadeMessage:(UIStoryboardSegue *)segue;(h)
- (IBAction)retrievePremadeMessage:(UIStoryboardSegue *)segue
{
PreStoredMessagesTableViewController *cc = segue.sourceViewController;
self.textViewMsg = [[UITextView alloc] init];
self.textViewMsg.text = cc.valeurCell;
NSLog(@"cell selected: %@", cc.valeurCell);
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

// Retrieve the value of cell selected
self.valeurCell = [NSString stringWithFormat:@"%@", [tableView cellForRowAtIndexPath:indexPath].textLabel.text];
}
感谢您使用此方法:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

// Retrieve the value of cell selected
self.valeurCell = [NSString stringWithFormat:@"%@", [tableView cellForRowAtIndexPath:indexPath].textLabel.text];
}
加:

然后你可以这样做:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSString *stringPassedIn = id;
}

segue“identifier”将tableViewCell与ohter UIViewController链接,或者它具体做什么?Thanks@dev99在Interface Builder中,当您进行控制时,从一个ViewController单击并拖动到另一个ViewController会创建一个序列。推送序列用于由UINavigationController管理视图时,模式序列用于以模式显示下一个视图。控制从一个ViewController单击并拖动到下一个ViewController时,它将创建一个箭头。在这里,您可以在XCode的最右窗格中更改类型;还可以指定标识符。抱歉,这是一个很好的答案,我正在其他地方寻找解决方案,但没有看到您的答复。谢谢