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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:10:11+00:00 2026-05-22T18:10:11+00:00

Why does the following crash my app whenever this view is loaded? -(void)loadView {

  • 0

Why does the following crash my app whenever this view is loaded?

-(void)loadView {
    UIButton *chooseSubjectButton = [[UIButton buttonWithType:UIButtonTypeDetailDisclosure] retain];
    [chooseSubjectButton addTarget:self action:@selector(chooseSubject) forControlEvents:UIControlEventTouchUpInside ];
    chooseSubjectButton.frame = CGRectMake(15.0f, 205.0f, 296.0f, 51.0f);
    [self.view addSubview:chooseSubjectButton];
}

Any help would be greatly appreciated.

Thanks!

  • 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-22T18:10:11+00:00Added an answer on May 22, 2026 at 6:10 pm

    My guess is, your app is not crashing actually. It just keeps calling the loadView method repeatedly because you’ve missed to load the view. Call [super loadView] or create a view and assign it as self.view before you add anything to self.view. The convenient way would be to use [super loadView].

    - (void)loadView {
    
        [super loadView];
        // Your Code Here
    }
    

    EDIT: This answer looks to be wrong. Please consider visiting Is it ok to call [super loadView]? as @Denis Vert pointed out in the comments.

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

Sidebar

Related Questions

For some reason the following doesn't crash like my program does, but I'm pretty
I'm getting crazy with this IE 7... ==> hhttp://neu.emergent-innovation.com/ Why does following function not
Why does the following method hang? public void pipe(Reader in, Writer out) { CharBuffer
I have the following crash that I can't replicate on demand but does happen
My app, which uses ARC, does the following: Uploads a picture taken by the
This is similar to What does zero-sized array allocation do/mean? I have following code
a user reported the following crash in my iPad app. Thread 0 name: Dispatch
I am getting a crash in my app due to the following error: -[NSCFString
The following process leads to a crash of my app: the user opens a
does the following integer arithmetic property hold? (m/n)/l == m/(n*l) At first I thought

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.