I am making an application solely for the purpose of learning more objective c. This application basically takes a user to a modal view and then gives the user options (uibuttons) to click. When a user taps a button, the modal view is dismissed and I would like to take the data taken from that button (whether it’s the title of the button, tag, etc, whichever is easiest to use) and store it as a variable in my main view. I have tried using an extern NSString defined in a seperate .h file, but no luck. What am I missing?
Share
You have to go through delegate pattern in iOS.
You can pass the value back to the main view using delegate methods.
Apple documentation on Protocols.
Example using Protocol