Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3996530
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:17:26+00:00 2026-05-20T07:17:26+00:00

Im new to objective-c and I’ve been reading up on singleton classes. I want

  • 0

Im new to objective-c and I’ve been reading up on singleton classes. I want to implement it into my logic but im not sure if its correct/possible/doable to do so, any advise would be appreciated.

At the moment i’m loading data from an xml feed, but i want to have control what data should be displayed based on which button is clicked. For example, buttonA would display IT news and buttonB would display celebrity news.

My thinking is to load the xml data into sqlite on application start in the background and display my buttons view at the same time using the singleton class. If the user pushes the button it will query the required table and display the content into a tableView.

Is this viable? If not, could you please advise whats the best way to go about this?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:17:27+00:00Added an answer on May 20, 2026 at 7:17 am

    First of all you should reconsider organization of your data model. You’ve named sqlite on one hand and a global array on the other.

    I would point you to Core Data to store your parsed data in a convenient way. Finally all you need is to query the Core Data db and fetch what you need. This would be more memory efficient than storing your data in a global array.

    Have a look at Apple’s Core Data tutorial or at this nice turorial: “superdb-core-data-app-with-sections”

    To share a managed object context you can use a singleton. Have a look at this blog post, it provides a solution without a singleton by passing references of the managed object context down the relevant objects. It is created in the app delegate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I implement this method (see below)? I'm new to Objective-C and I'm
Currently, my Objective C classes use C++ objects by doing a new when the
(New to Objective-C, but well versed in C/C++). Presently I have an Objective-C class
another Objective-C one for you, probably pretty obvious but I have been at this
Still new to Objective C, and I'm having some trouble that I just can't
I'm new with Objective-C, so there probably is a simple solution to this. I
I'm new to Objective-C and iPhone development, and I'm trying to store floating-point values
I am currently working on an iPhone 2.1 application. I am new to Objective
I am a new Objective-C programmer coming from a C#, VB.NET, Etc. These are
I have a brand new Objective-C class called test . The test class has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.