0

親View Controllerにデータを送信する必要があります。だから(親で)setLocWithName: loc:これを行うメソッドを作成しました。親コントローラーであるオブジェクトを作成するにはどうすればよいですか? parentViewController私もpresentingViewController(以下に示すように) 試しましたが、警告が表示されます:

タイプ 'UIViewController *' の式で 'TDViewController *__strong' を初期化する互換性のないポインター タイプ

// set object of parent view controller
TDViewController *tDViewController = [[self navigationController] presentingViewController];

// get data
NSArray *locs = [[PLStore sharedStore] allLocs];
PL *setselectedLoc = [locs objectAtIndex:[indexpath row]];

// send data to parent view controller 
[tDViewController setLocWithName:[setselectedLoc pLocName] loc:[setselectedLoc loc1]];

// Pop this view controller off the stack
[self.navigationController popViewControllerAnimated:YES];
4

2 に答える 2