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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:53:23+00:00 2026-05-27T01:53:23+00:00

I am working a big iOS project, the design is not a nice as

  • 0

I am working a big iOS project, the design is not a nice as I would like it to be, but I must stick to it. (life can be a bitch sometimes).

The thing is that we have a Library that basically let’s you browse a catalog. You have a filter, where you specify a certain search criteria, and you are presented with a list were you can press on the items that you are interested. When you press an item, you can see a more detailed description of it.

The company were a work for, sells this same software to many different companies that have different catalogs. The idea is that the Library has all the main functionality, and the project that use it, might in some way extend or completely override some of the given interfaces.

To give you an example, imagine my library has 2 classes that manages 2 views. They would be “FilterViewController” and “DetailsViewControllers”. In some place of the code this classes gets instantiated. It would look something like this

Class diagram schema

My approach is something like this:

ProjectA side

// Here I configure the library
Library.FilterViewClass = ProjectAFilterViewController;
Library.DetailsViewClass = ProjectADetailViewController;

ProjectB side

Library.FilterViewClass = ProjectBFilterViewController;
Library.DetailsViewClass = nil;

Library side

// Did the user configure the library?
if(self.FilterViewClass == nil){
    // I alloc the default ViewController
    myFilterViewController = [[FilterViewController alloc] init]; 
}else{
    // Here I would like to alloc the custom ViewController
    myFilterViewController = [[Library.FilterViewClass alloc] init]; // DaProblem!
}

The problem with that approach is that I actually don’t know if it’s possible to instantiate object programmatically. Or at least I don’t know how. Maybe I am using the wrong approach, some direction would be appreciated. Txs in advance!

  • 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-27T01:53:24+00:00Added an answer on May 27, 2026 at 1:53 am

    To get class from string you can use this function

    Class cl = NSClassFromString(@"MyClass");
    

    To get class of existing variable just call class method.

    Class cl = [obj class]; // assuming obj1 is MyClass
    

    Now you can create instance of MyClass

    MyClass *myClass = (MyClass*)[[cl alloc] init];
    ...
    [myClass release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will be working on a big Assembly project but am now just starting
EDIT: I have made a clean, new project, but still can't get it working.
I want to start working on a big project. I research about performance issues
I'm working with quite a big codebase which compiles fine in linux but vc++
I'm working in a big java project, with about 400 classes. Suddenly I got
I am currently working on this big project (a GUI to control hardware) that
see i am working in one BIG project source code Now i want to
I am working on a big .NET project. I am currently creating an automated
We're working on a big project and we're stuck a bit here. I need
I'm working on a big project, some might say awesome. The project is being

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.