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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:53:29+00:00 2026-05-28T06:53:29+00:00

As explained in this question , I have a view controller that needs to

  • 0

As explained in this question, I have a view controller that needs to replace itself with a different layout in certain cases where data may not be present. This seems to work:

if ([analysis length] == 0) {
    hasReview = NO;
    UnreviewedSPP* unreviewedSPPView = [[UnreviewedSPP alloc] init];
    unreviewedSPPView.ProductName = self.productName;
    unreviewedSPPView.SdcId = self.sdcId;
    unreviewedSPPView.Delegate = self;
    NSArray* newViews = [[NSBundle mainBundle] loadNibNamed:@"UnreviewedSPP" owner:unreviewedSPPView options:nil];
    self.view = [newViews objectAtIndex:0];
    return;
}

However, it seems that I cannot push a new view controller from within the replacement view:

    [priceButton handleControlEvent:UIControlEventTouchUpInside withBlock:^{
        WebViewController* wv = [[[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil] autorelease];
        wv.url = offerURL;
        [Delegate performSelector:@selector(pushViewControllerFromSubview:) withObject:wv];
    }];

priceButton is a custom button object that can perform a block as a target action.

I’ve tried multiple approaches: passing the outer view controller as a delegate and passing the outer view controller’s navigation controller as a property on the inner view controller.

Nothing seems to work. Is there a better solution?

  • 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-28T06:53:29+00:00Added an answer on May 28, 2026 at 6:53 am

    Question:

    1) Is wv being retained… when you call pushViewControllerFromSubview? I notice you have an autorelease deal here. Check the wv view within pushViewControllerFromSubview.

    2) Another approach for replacing views is to use the ‘[self.view addSubView:myView];’ and [myView removeFromSuperView];’… that may be a better approach than pushing the view controller.

    Cheers

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

Sidebar

Related Questions

First: I'm shocked that I have to ask this question. Nowhere in the docs
I have a view controller initialized like this: HomeViewController *homeVC = [[HomeViewController alloc] initWithNibName:@HomeViewController
I have found answers to this question that explain how to convert an NSString
the question explains it all. For instance, if I have a NSDictionary like this
I'll try to explain this better on another question. This is the query that
inHi, this question is fast, but from my point of view its pretty hard.
Hello I recently posted this question but very badly explained the problem, but i'll
I recently answered this question how-to-call-user-defined-function-in-order-to-use-with-select-group-by-order-by My answer was to use an inline view
Short: Is there a way to have a route-definition that will pass the CONTROLLER/ACTION
I have the following situation: From within a view controller, I go about creating

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.