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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:59:11+00:00 2026-06-18T14:59:11+00:00

In my class I have a generic initializer: – (id)initWithSettings:(MySettings *)settings { self =

  • 0

In my class I have a generic initializer:

- (id)initWithSettings:(MySettings *)settings
{
    self = [super init];
    if (self)
    {
     /// ...
    }
    return self;
}

And it has another initialiser with fixed setting

- (id)initWithSettingsForCaseA
{
    return [self initWithSettings:[MySettings genericSettings]];
}

Can I do this?

  • 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-06-18T14:59:12+00:00Added an answer on June 18, 2026 at 2:59 pm

    Of course you can!

    This is actually a good practice.

    initWithSettings: is called the “designated initializer”. There’s no programmatic way of defining the designated initializer. This is more of a design pattern/best practice.

    Take for instance the designated initializer for a UIViewController, initWithNibName:bundle:..you can still call plain ol’ init and everything will work just fine as long as your nib is named the same as your view controller subclass. UIViewController simply calls its designated initializer and passes nil for both parameters.

    You’re essentially doing the same thing!

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

Sidebar

Related Questions

Problem: I have a generic super class with type T at GWT client side
In my base class I have a generic method (ideally this would be a
I have generic type that looks like: public class GenericClass<T, U> where T :
I want to write in Delphi (2009 - so I have generic dictionary class)
I have a generic class that needs to limit an enum depending on the
I have a generic class that takes a type T . Within this class
I have a generic class HierarchicalBusinessObject. In the constructor of the class I pass
I have a generic class NamedValue<TValue> : public class NamedValue<TValue> { public string Name
I have a Generic Base Class that I want to allow one of two
Suppose I have a Generic abstract class that provides some default constructor functionality so

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.