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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:02:08+00:00 2026-05-24T16:02:08+00:00

So I have an app where I’m implementing a universal tool bar that sort

  • 0

So I have an app where I’m implementing a universal tool bar that sort of acts like a tab bar + tool bar and is featured on all of my view controllers. I have a custom tool bar that has some buttons that manipulate some navigational view controllers I’ve created in the App Delegate. However, I am having trouble getting these buttons to work, below is an example of an action method for one of the buttons I’m using:

    Test_ClassAppDelegate *test_ClassAppDelegate = (Test_ClassAppDelegate*)[[UIApplication sharedApplication] delegate];
[[[test_ClassAppDelegate window] superview] removeFromSuperview];
[[test_ClassAppDelegate window] addSubview:[[test_ClassAppDelegate helpNavController]view]];
[test_ClassAppDelegate release];    

I think the main area I might be going wrong is in my second line where I’m removing my superview. I’m not even sure if this is the correct way to go about doing that. I know I could implement this code in the app delegate itself, but am curious is there anyway to remove the superview from else where, or if anyone else sees any problems with this code. 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-24T16:02:08+00:00Added an answer on May 24, 2026 at 4:02 pm

    Yes, that line is certainly a problem…

    From the UIWindow reference:

    The window is the root view in the view hierarchy.

    Thus, a window has no superview, and you’re asking the window‘s superview to remove itself from its superview. This doesn’t work for the same reason that it’s such a tongue-twister–it just doesn’t make sense.

    Furthermore, -removeFromSuperview doesn’t remove a superview, it removes the view to which you are sending -removeFromSuperview from its superview. Do you see the difference?

    It sounds like you’re wanting to change the root view controller based on a user selection. If that’s the case, see my answer to this question, and lots of others on SO.

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

Sidebar

Related Questions

I have an app that currently holds all state in memory. It fetches a
I have an app that uses the Status bar is initially hidden property in
I have an app built in CI and I would like that sessions don't
I have an app that needs to open a new window (in the same
I have an app written in C# that lies on a network share. When
I have an app that executes commands on a Linux server via SSH just
I have a app that I'm deploying to a development server using Capistrano. I'd
I have an app that is failing on the install. The vendor says I
I have app that uses ClickOnce deployment. It works on about a dozen machines
I have app that uses two threads: one thread for regular application work and

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.