Return values for NSViewController

Hi, I have two NSViewController, VC1 and VC2. VC1 activates VC2 using segue and sends a struc object that will be used in VC2 to execute a process, fills in other data in the received object that should be visible in VC1. To terminate VC2 do vc2.dimiss. How do I know that focus has returned to VC1? Which method is executed on VC1 on return? Thanks.

Answered by Claude31 in 747113022

Which method is executed on VC1 on return?

Not sure to fully understand.

When you dismiss VC2, you should automatically get focus of VC1. But no code is executed.

You could however post notification from VC2 when dismissing and have VC1 subscribe to it.

See some details in this old thread: https://developer.apple.com/forums/thread/71955

Accepted Answer

Which method is executed on VC1 on return?

Not sure to fully understand.

When you dismiss VC2, you should automatically get focus of VC1. But no code is executed.

You could however post notification from VC2 when dismissing and have VC1 subscribe to it.

See some details in this old thread: https://developer.apple.com/forums/thread/71955

Tanks Claude31,

The answer for my problem I find here: https://developer.apple.com/forums/thread/112517?answerId=345249022#345249022.

Return values for NSViewController
 
 
Q