0

I'm asking this because I haven't found answer or solution on any other topic, sorry if this question was already asked and answered. THIS didn't answer my question, although problem is similar.

I am trying to explain it as possibly good as I can.

I'm having a singleton containing data used in application, let's call it DataStore. I'm trying to change some value in it, let's say DataStore.x, using one of IBActions (by pressing one of multiple buttons in View1). This button is also responsible for changing view to View2, modal link. viewDidLoad function from View2 is using DataStore.x variable. Problem : DataStore.x isn't set by IBAction yet when it's being used by viewDidLoad (using NSLog gave me information that value is being set, but too late).

prepareForSegue function would be perfect if I knew inside it which button was pressed, so before I switch views I can put the proper value to DataStore.x.

Thank you for your time.

Karol

Community
  • 1
  • 1
thedazed
  • 81
  • 1
  • 7
  • If the button is initiating the segue, the sender augment in prepareForSegue will be the button that you clicked, so you can figure out which button it was using the button title or a tag. – rdelmar Jul 27 '14 at 21:18
  • Simple and easy - thank you sir. – thedazed Jul 27 '14 at 22:44

0 Answers0