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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:18:10+00:00 2026-05-13T09:18:10+00:00

I am working on an app that has several different views, two of the

  • 0

I am working on an app that has several different views, two of the which are DetailViewController.h&.m and AddViewController.h&.m. Neither of these particular view have IB xib files associated with them, they just have programmatically generated UITableViews. These views essentially are the same, the only difference, is that in the AddViewController, you put info into cells, and in the DetailViewController that same info is viewable and editable. Essentially the viewDidLoad for the AddViewController overrides the DetailViewController viewDidLoad with different navigation bar items and title. MY QUESTION: Outside of IB, how do I reference which view I am in? I want to have some switches and buttons available in the DetailView, that I don’t want available in the AddView. But being that as it is, they are refferencing the same info, and currently just changing the navigation bar items, they aren’t seperate like I would like them to be. Inside the DetailView viewDidLoad I’m thinking I need something where its like

if(currentView = DetailView) {
self.view addSubview: onOffSwitch;
}
else onOffSwitch. hidden = YES;

Or something to that effect. Obviously if the above code actually worked, I wouldn’t be writing this question 🙂 Its probably just a syntax issue I can’t hammer out, if you could please help me out, it 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-13T09:18:11+00:00Added an answer on May 13, 2026 at 9:18 am

    Well there is similar question here

    But for your case you can do it like:

    if([[self class] isKindOfClass:[DetailViewController class]]) {
    self.view addSubview: onOffSwitch;
    }
    else 
    onOffSwitch. hidden = YES;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a simple app tab-bar based application that has two views.
We're designing an Android app that has several activities which are working in a
I'm working on a PHP app that has several objects that can be commented
I am working on an android app that has a database in which one
I have inherited a working VB.NET 2.0 web app that has several User Controls
I'm working on an app that has some forms that are contained within a
Im working on an app that now has to go to a URL online
I'm working on a Silverlight app that has an UnhandledException handler in the App
I'm working on a rewrite of an app that has three categories of users
I am working on a web-app system that has multiple apps, each with a

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.