-2

I'm doing this application made of 3 view controllers. The current flow is like this:

1) The first takes you to the second .
2) You enter a password to reach the third view controller.
3) In the third the user enters a series of messages saved in an nsmutablearray.

Now, I want to send the array to the first view controller. I pass through the view controllers using segues made on the storyboard.
So vc1 is connected to vc2, vc2 to vc3 and vc3 to vc1. I tried using protocols, notification center and so on. Protocols don't work and i don't get why, notification center the data gets sent but then the array in vc1 when I try to use it, it is actually set back to nil which I also don't know why.

What can be done to solve this issue, I feel its a pretty straightforward implementation and shouldn't face be that complicated.

Thanks in advance

Ichigo Kurosaki
  • 3,765
  • 8
  • 41
  • 56
  • There are 4 basic ways you can achieve this: Protocols, Notification center, Blocks, Unwind segue. If you can you show your code, i'll be able to help you better. – Abubakr Dar Feb 01 '15 at 12:18

1 Answers1

-1

Beginner idea: If I were in your case, I would create my array in vc1. Then use the prepareForSegue to connect the vc1 with vc2, and same with vc2 and vc3. With that way, you can access the array even if you are in vc3 (remember to make the array @property in order to allow other vc to access it)

The only downside of this idea is if you have to many vc, the connection will be a big mess :)

Tree Nguyen
  • 1,198
  • 1
  • 14
  • 37