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

  • Home
  • SEARCH
  • 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 7175311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:15:46+00:00 2026-05-28T16:15:46+00:00

I’ve read several threads about the differences between Singletons and Classes in various languages,

  • 0

I’ve read several threads about the differences between Singletons and Classes in various languages, but none (that I can find) specific to Objective-C.

They seem very similar to me.

I’m new to objective-c – so what are the differences, or usage cases between Singletons and Classes?

  • 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-28T16:15:47+00:00Added an answer on May 28, 2026 at 4:15 pm

    You are programming in Objective-C, an Object-oriented programming language (OOP). So, to know what a class is, you must first understand OOP concepts.

    I wont go into why OOP languages was developed as opposed to procedural languages. You can google “procedural vs objective oriented advantages”.

    Anyway,
    Object Oriented Programming languages (OOP) provide mechanisms/devices/structures that helps you implement OOP principles. 3 main principles are (1)Encapsulation (2)Inheritance (3) Polymorphism. Again google to find out what these are.

    Now a Class: would be one of those mechanisms/devices/structures that implements the 3 OOP principles. It is a blueprint/design/structure of what an object should be.
    Typically (but not always) a class would have (1) variables declared within it (strings, int, arrays, whatever) and (2) Methods/functions that perform a task on those declared variables within it. When you instantiate/allocate/create-that-class-in-memory, that class becomes “alive”. The blueprints now become an object (an object that implements the OOP principles you are supposed to google).

    Now a Singleton is a design pattern. If you’re a coming from a procedural language environment, there are many programming design patterns you may need to catch up on. A Singleton is a pattern/a-particular-way-you-design-someting. So when you say a singleton class, it is a particular way you design that class. And what is that particular design? Well, usually when you instantiate/allocate/create-a-class-in-memory, you can do it many times, there by creating multiple instanced objects of that class. If you apply a singleton design pattern to a class however, you ensure that only one instance (and ONLY one) can be created.

    In Objective-C if i do something like this:

    myClass *anObjectOfMyClass1 = [[myClass alloc] init];
    // This (above) would create an object from the blueprint *myClass* and assign it to *anObjectOfMyClass1*
    myClass *anObjectOfMyClass2 = [[myClass alloc] init];
    // This would create an object from the blueprint *myClass* and assign it to *anObjectOfMyClass2*
    // Note: anObjectOfMyClass1 and anObjectOfMyClass2 would contain two different objects of the same type
    // If *myClass* was designed using  singleton pattern however, anObjectOfMyClass1 and anObjectOfMyClass2 would typically contain the same object.
    

    In short.. you really cant compare the two.
    As for the usage of singletons.. I would say Loggers. I think there are already answers around stackoverflow about uses of singletons. Look around a bit.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.