Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I target a delegate to a "specific" instance of a ViewController, to get it's data?
    primarykey
    data
    text
    <p>How can I do this?</p> <p>I have <strong>ViewController 1</strong>, and <strong>ViewController 2</strong>.</p> <p><strong>ViewController 1</strong> defines a protocol and <strong>ViewController 2</strong> conforms to it.</p> <p>I set <strong>ViewController 2</strong> has a delegate and invoke a method in <strong>ViewController 1</strong>. This method runs fine. And send confirmation back to my <strong>ViewController 2</strong>.</p> <p>I can exchange data between them, but I'm trying to figure out a way, to get data from a <strong>particular instance</strong> of <strong>ViewController 1</strong>, to <strong>ViewController 2</strong>.</p> <p>Because when I'm using my delegate, to run a method in <strong>ViewController 1</strong> it's not going for that particular instance that I'm interested in.</p> <p>Is there a way I can resolve this?</p> <p>Can I set my delegate, a delegate of a particular instance so I can get it's state? Is this possible? And if so, how?</p> <p>In other words, can I target a specific instance with my delegate?</p> <p>--</p> <p>p.s. if I try to get data of a property ruled by ViewController 1, it come has nil (I think this is because I'm not targeting a particular instance)! One way I can resolve it, is have a method that reads "already saved data". But I would be replicating code, and instantiating new objects with data that is already available in previous ViewControllers.</p> <p>Any help is most appreciated. Thank you in advance!</p> <p>Nuno</p> <p>edit:</p> <pre><code>SetupTableViewController *delegate = [[SetupTableViewController alloc] init]; [delegate setDelegate:self]; </code></pre> <p>Every property I try to get from this point on forward, is nil. How can I target this to a particular instance of my previous ViewController? I do not want to instantiate a new SetupViewController. What I really need is to access an existing instance of my SetupViewController.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload