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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:58:26+00:00 2026-06-14T15:58:26+00:00

On click each button showing subview view contains learn and play option.While clicking ,

  • 0

On click each button showing subview view contains learn and play option.While clicking , want to show the different view depends on the uibutton selection.Here my code .

-(IBAction)animals
{

CGPoint point = [tap locationInView:self.animalsbut];

pv = [PopoverView showPopoverAtPoint:point inView:animalsbut withContentView:alertvu    delegate:self];
pv.tag=1;

}
-(IBAction)birds
{
   CGPoint point = [tap locationInView:self.birdsbut];

pv = [PopoverView showPopoverAtPoint:point inView:birdsbut withContentView:alertvu delegate:self];
pv.tag=2;
//[self checkingme:pv.tag];
}
-(IBAction)direct
 {  
  CGPoint point = [tap locationInView:self.direcbut];
pv = [PopoverView showPopoverAtPoint:point inView:direcbut withContentView:alertvu delegate:self];
pv.tag=4;
}
-(IBAction)fruit
{

CGPoint point = [tap locationInView:self.fruitbut];
pv = [PopoverView showPopoverAtPoint:point inView:fruitbut withContentView:alertvu delegate:self];
pv.tag=3;
}

method

-(IBAction)check:(NSInteger)sender
{
UIButton *mybutton =(UIButton*) [self.view viewWithTag:sender];

if(pv.tag==1)
{
    NSLog(@"button log%d",mybutton.tag);
if(mybutton.tag==0)
{

    animallearn *aview=[[animallearn alloc]initWithNibName:@"animallearn" bundle:nil];
    [self.navigationController pushViewController:aview animated:YES];
    [pv performSelector:@selector(dismiss) withObject:nil afterDelay:0.1f];
}
else //(mybutton.tag==1)
{
    playview *pview=[[playview alloc]initWithNibName:@"playview" bundle:nil];
    [self.navigationController pushViewController:pview animated:YES];
   [pv performSelector:@selector(dismiss) withObject:nil afterDelay:0.1f];
}

}
else if(pv.tag==2)
{
    if(mybutton.tag==0)
    {
        birdview *aview=[[birdview alloc]initWithNibName:@"birdview" bundle:nil];
        [self.navigationController pushViewController:aview animated:YES];
        [pv performSelector:@selector(dismiss) withObject:nil afterDelay:0.1f];

    }
   else if(mybutton.tag==1)
   {
       playview *pview=[[playview alloc]initWithNibName:@"playview" bundle:nil];
       [self.navigationController pushViewController:pview animated:YES];
       [pv performSelector:@selector(dismiss) withObject:nil afterDelay:0.1f];
   }
}
else if(pv.tag==3)
{
    if(mybutton.tag==0)
    {
        fruitview *aview=[[fruitview alloc]initWithNibName:@"fruitview" bundle:nil];
        [self.navigationController pushViewController:aview animated:YES];
        [pv performSelector:@selector(dismiss) withObject:nil afterDelay:0.1f];           
    }
    else if(mybutton.tag==1)
    {
        playview *pview=[[playview alloc]initWithNibName:@"playview" bundle:nil];
        [self.navigationController pushViewController:pview animated:YES];
        [pv performSelector:@selector(dismiss) withObject:nil afterDelay:0.1f];
    }
}
else if(pv.tag==4)
{
    if(mybutton.tag==0)
    {
        directview *aview=[[directview alloc]initWithNibName:@"directview" bundle:nil];
        [self.navigationController pushViewController:aview animated:YES];
         [pv performSelector:@selector(dismiss) withObject:nil afterDelay:0.1f];
    }
    else if(mybutton.tag==1)
    {
        playview *pview=[[playview alloc]initWithNibName:@"playview" bundle:nil];
        [self.navigationController pushViewController:pview animated:YES];
        [pv performSelector:@selector(dismiss) withObject:nil afterDelay:0.1f];
    }
}
else
{

    return ;
 }
 }

Here problem is whenever i second button it showing the button tag 0 view only in all the cases?Can any one help me to sort it out

  • 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-06-14T15:58:27+00:00Added an answer on June 14, 2026 at 3:58 pm

    You should also set the tags of UIButtons/UIViews you want to access via tag. like secondButton.tag = 3; and the sender argument passed is not of type NSInteger it is of UIView, so change it like this! This is should solve your problem!

    -(IBAction)check:(id)sender 
    {
        UIButton *mybutton =(UIButton*) sender;
        // continue whatever you were doing earlier!
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application ,i having 4 UIbuttons .On click each button showing subview view
In my application ,i having 4 UIbuttons .On click each button showing same alert
I want to attach a click event handler to each and every (Button, Anchor,
Each time I click the Run as button, I get the following message. The
For each click I want to increase the font size. $('#fontplus').each(function('click') { var fs
I'd like to grow a view with each click using a ScaleAnimation. I've managed
I want to display multiple markers, and when i click on each marker it
$(document).ready(function() { $(#FieldsetID).each(function() { $('.Isubmit').attr('disabled', 'disabled'); }); }); the button showing as disabled but
I have 25 products showing in a page. Each product contains a form within
In listview im showing product information .On each row there is one select button

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.