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 6609203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:41:26+00:00 2026-05-25T19:41:26+00:00

Reading through Apple’s documentation on Tips and Techniques for Framework Developers , I came

  • 0

Reading through Apple’s documentation on Tips and Techniques for Framework Developers, I came across this statement about designated initializers:

A designated initializer is an init method of a class that invokes an
init method of the superclass. (Other initializers invoke the init
methods defined by the class.) Every public class should have one or
more
designated initializers.

(Emphasis added.)

Based on my understanding—and indeed, the very use of the word “designated”—a class should have only one designated initializer. But according to the documentation, multiple designated initializers are acceptable.

Assuming that you have two (or more) designated initializers, their role is to call the superclass’s designated initializer in order to guarantee proper object initialization. But if both designated initializers are calling the same superclass’s designated initializer, then why was there the need for more than one in the first place? Shouldn’t the class be refactored to funnel all the other init methods to the singular designated initializer?

I’m just a bit confused as to what use case or design pattern would call for multiple designated initializers?

  • 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-25T19:41:27+00:00Added an answer on May 25, 2026 at 7:41 pm

    You would do this when you want to have a different initialization for different objects of the same class. One example is class clusters, like NSNumber. It has quite a few initializers for the different types of numbers they can hold. To provide the most accurate representation, the class should hold its value in the same format it received it in, instead of casting. This means the initializers can’t simply call a common initializer and return. They need to do some custom work. This makes them a designated initializer.

    Another example would be a document class which needs to do some initialization only for new files and some other initialization only for documents being opened. Both of these initializers will call their super implementation, which in turn calls the plain init method to do common initialization. However, since they do more than simply calling another initializer with a default value, they are considered designated initializers.

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

Sidebar

Related Questions

Whilst reading through K&R, I came across the integer to string function. I gave
Reading through the Flickr API documentation it keeps stating I require an API key
Reading through this question on multi-threaded javascript, I was wondering if there would be
I have been reading through the C++ FAQ and was curious about the friend
I'm reading through the Zend Framework coding standards , where they state that curly
I'm reading through K&R and came to the small section on register variables, and
I'm reading through A Gentle Introduction to Haskell, and early on it uses this
I'm reading through TableView_iPhone tutorial from Apple and I'm trying to use 'The Technique
I've been reading through the documentation for Kohana ORM and in their example model
I'm reading through head first design patterns at the moment and while the book

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.