ストーリーボードの使用方法を学習しようとしていますが、テーブル ビューから詳細ビューへのコントロール ドラッグに問題があります。基本的に、auto-connect
何か設定が間違っているようなものではありません。
これがちょっとしたものです:
私もこれを行うことができるはずですか?
セル作成のための私のコードは次のとおりです。
-(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier=@"MyCell";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell==nil){
cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text=self.tasks[indexPath.row];
return cell;
}
ビューコントローラーのコードは次のとおりです(ただし、これは関連していないようです)。
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"taskSegue" sender:self.tasks[indexPath.row]];
}
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
UIViewController *destination = segue.destinationViewController;
if([segue.identifier isEqualToString:@"taskSegue"])
[destination setValue:sender forKeyPath:@"task"];
else
destination = [segue.destinationViewController topViewController];
[destination setValue:self forKeyPath:@"delegate"];
}
thx fo