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

I am new to Objective-C and iOS development and I'm not sure if I'm
I'm quite new to objective c but have been programming for a while. I
I'm new to Objective-C and I'm not sure if I'm using NSAutoreleasePool the right
New to Objective-C iPhone/iPod touch/iPad development, but I'm starting to discover lots of power
(New to Objective-C, but well versed in C/C++). Presently I have an Objective-C class
I am new to Objective-C and I want to let a screenshot made with
I'm fairly new to Objective-C, and am currently reading up on memory management. I'd
I'm new to Objective-C and MVC. Ive been following along with Paul Haggerty's Coursework
First of all, I am a a very new Objective C/Cocoa iOS Developer but
I am an Objective-C newbie, who still does not have a Mac, but still

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.