I want to have a global array/variable in an iPhone app that uses storyboard. Is there a way to access such a global variable from a number of different storyboard screens?
Thanks
Kevin
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.
The storyboard part is somewhat irrelevant: the standard way of achieving this in cocoa is to define a singleton object as your model, share its header among the controllers defined in your application (through storyboard or otherwise) and create an instance of your shared model in the application start-up code.
For information on implementing singletons in Objective C read this link.