I’d like to listen/detect a didSelectRowAtIndexPath: change in viewController1 and then based on this selection change something in viewController2.
Any idea how I might go about doing this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use a KVO.
First create a @property in ViewController1.h:
In ViewController1.m:
In ViewController2.m, assuming you have a reference to ViewController1 (i.e. vc1) already, set up the Observer in your viewDidLoad:
and lastly add the following somewhere in ViewController2
eta:
You must also remove the observer in ViewController2’s dealloc: