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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:51:37+00:00 2026-05-12T05:51:37+00:00

I have a UIViewController subclass called TripViewController. This class has the following method: –

  • 0

I have a UIViewController subclass called TripViewController. This class has the following method:

- (void)lockScreen {
  LockOverlay *lockOverlay = [[LockOverlay alloc] init];
  [self presentModalViewController: lockOverlay animated:YES];
}

LockOverlay is also a UIViewController subclass, defined as follows (the rest of the code is just auto-generated stubs):

// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
  CGRect frame = CGRectMake(0, 0, 225, 37);
  UIImageView *sliderBackground = [[UIImageView alloc] initWithFrame:frame];      
  sliderBackground.image = [UIImage imageNamed:@"slider-bar.png"];  
  UIImageView *unlock = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"unlock.png"]];
  [sliderBackground addSubview:unlock];
  frame = CGRectMake(10, 360, 225, 37);
  Slider *slider = [[Slider alloc] initWithFrame:frame];
  [slider addSubview:sliderBackground];
  slider.unlock = unlock;
  [self.view addSubview:slider];
}

When lockScreen gets called, the program goes into an infinite loop, and loadView gets called over and over.

So, what am I doing wrong here? I’ve had a bug like this before… In the App Delegate, I create a TabBarController, and one of the views has a NavigationController. I got the same sort of bug when I tried to add the View instead of the NavigationViewController to the tabBar array. I assume this problem is similar and I’m not pushing the new ViewController to the right place, but that’s just a guess.

  • 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-12T05:51:37+00:00Added an answer on May 12, 2026 at 5:51 am

    I changed loadView to be initWithFrame and returned self. It works now.

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

Sidebar

Ask A Question

Stats

  • Questions 201k
  • Answers 201k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Maybe there's some sort of getchar with a timeout that… May 12, 2026 at 8:07 pm
  • Editorial Team
    Editorial Team added an answer No, you can only use exponentiation, because the sum of… May 12, 2026 at 8:07 pm
  • Editorial Team
    Editorial Team added an answer Atlassian has the solution for your problem: Clover. But it… May 12, 2026 at 8:07 pm

Related Questions

I have a UIViewController subclass called TripViewController. This class has the following method: -
I have written a UITabBarController subclass (called MainViewController ) and added a few instance
I have a root UIViewController subclass that has a UITabBar, (I'm not using UITabBarController)
I'm an experienced software developer (mostly C and C++ in embedded systems, Linux, and
I have a UIViewController subclass that accesses self.navigationController in viewDidLoad:. Depending on where it

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.