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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:16:05+00:00 2026-06-02T11:16:05+00:00

I have a project with one View. I’m drawing everything on it programically. So

  • 0

I have a project with one View. I’m drawing everything on it programically. So when i want to add another View (screen) to my project i create a class inherits from the UIViewController class and implements method

- (void)viewDidLoad

And then i want to load this View from my original View, and i do this:

In ViewController.h

#import <UIKit/UIKit.h>
#import "TestViewControllerClass.h"

@interface ViewController : UIViewController <UITableViewDataSource> {
}

@property (strong,nonatomic) TestViewControllerClass *testView;

@end

In ViewController.m

@implementation ViewController

@synthesize testView;

- (void)viewDidLoad
{
    [super viewDidLoad];

    testView = [[TestViewControllerClass alloc] init];
    [self.view addSubview:testView]; //crash here

}

And then in my TestViewControllerClass.h

#import <UIKit/UIKit.h>

@interface TestViewControllerClass : UIViewController

@end

And TestViewControllerClass.m

- (void)viewDidLoad
{
    [super viewDidLoad];
}

To check if method wiewDidLoad will be executed i put there a breakpoint, but nothing happend. In fact, my app crash (I put comment at code where).

When crashes i receive: -[TestViewControllerClass superview]: unrecognized selector sent to instance 0x683aca0

  • 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-02T11:16:14+00:00Added an answer on June 2, 2026 at 11:16 am

    Replace

    [self.view addSubview:testView]; //crash here
    

    with

    [self.view addSubview:testView.view];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have below html code in one of the opensource project. <form action=/wiki/bin/view/Main/Search> <div
i need to have one project on asp.net mvc 1 but i want to
I have migrated Project server from one server to another. I am able to
I have a project on one computer that I need to work on another
So I have two view controllers in my iphone project - one of them
I have a project with a base view controller class, that is inherited by
Here I create one project that will track our current location. But I have
I have a simple project which consists of a simple window with one view
I am making one project in which use of map-view is required. I have
I have an OpenGL-based iPad project. In one view I have objects being rendered

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.