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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:34:40+00:00 2026-05-13T22:34:40+00:00

I have a App that uses the In App feature. -(void) completeTransaction: (skPaymenttransaction *)transaction{

  • 0

I have a App that uses the In App feature.

-(void) completeTransaction: (skPaymenttransaction *)transaction{



}

When the above method gets called i want to remove all subviews and go back to my main menu window (the first view in my App).

Can anyone suggest to cleanest and best way to do this?

Cheers

EDIT:

Just to make things clear

Im not sure if this makes a difference but i have my main menu screen, then iam doing the following with an enter button.

UIViewController *controller = [[UIViewController alloc] initWithNibName:@"NibFile" bundle:nil];
controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
[controller release];

Then i have a main screen with a button then when a user taps it, it then presents them with another modal view controller as above. On this view is a button that says BUY on it. They use clicks this and then the StoreKit does it business and once the payment is complete i want to get rid of the two modal controllers above and be left with the main menu screen.

Any Ideas.. ive tried as above

EDIT 2:

@Jordan Thanks,

But not sure if im doing this correctly. I understand the above code.

But when i start my app my app delegate loads a viewcontroller which is my main menu. Then i have a button that takes me to another view and on there is my features if the user clicks a feature that is not unlocked then it displays another view controller with the store on.

So with this in mind how do i get back to my main menu.

I have tried the following:

NSArray *subviews = [myAppdelegate.viewcontroller.view subviews]; 
for (int i=0; i<[subviews count]; i++) 
{ 
   [[subviews objectAtIndex:i] removeFromSuperview]; 
} 

but i get and error along the lines of:

expected ‘:’ before ‘.’ ?

  • 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-13T22:34:40+00:00Added an answer on May 13, 2026 at 10:34 pm

    This should work.

    // view is equal to your main view    
    NSArray *subviews = [view subviews];
    for (int i=0; i<[subviews count]; i++)
    {
       [[subviews objectAtIndex:i] removeFromSuperview];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WinForms app that uses the Settings feature of .NET 2, but
I have an iPad app that uses the storyboard board feature and then I
I have an app that uses sharekit to submit stuff to Twitter. I want
We have an app that uses simple one way binding with a GridView to
I have an app that uses EF. To test my stuff I generally wrap
I have an app that uses the python/c api and I was wondering what
I have an app that uses a tableview, along with a UIButton that I
I have an app that uses the iPhone camera and puts an overlay over
I have an app that uses Spring security and BlazeDS. Flex 3.2 is used
So I have an app that uses the Zend amazon web services client. I

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.