0

I am using sqlite to store the array of data and I have more than one view controller in my application and my question is Is it right to create a singleton class to control that array of information coz I don't want to recreate the array from sqlite file every time loading a new view controller into the memory?

3
  • 1
    Of course. Why do you even ask?
    – DarkDust
    Commented Aug 9, 2013 at 7:00
  • Does each view really show exactly the same data?
    – Wain
    Commented Aug 9, 2013 at 7:01
  • @Wain yes they are. I asked this because I have not done like this before.I always load array while loading a new view controller into the memory. Commented Aug 9, 2013 at 7:08

1 Answer 1

1

A singleton will work. You can also just pass the array from the current view controller to the new view controller when it gets created and displayed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.