Note that there are some explanatory texts on larger screens.

plurals
  1. POFetching the tag values on selector
    primarykey
    data
    text
    <p>I am working with the iphone project. In that i added 3 buttons with same selector name(i.e action). Now i am fetch the data from the database using the query. But it is showing me the data to 3rd button only when i am pressing any butoon out of three .</p> <pre><code>btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(80, 30, 200, 50); [btn.layer setBorderWidth:0]; btn.tag = 1; [btn setTitle:@"1" forState:UIControlStateNormal]; [btn addTarget:self action:@selector(detail:) forControlEvents:UIControlEventTouchUpInside]; btn.titleLabel.font = [UIFont fontWithName:@"Zapfino" size:14.0]; [scrollview addSubview:btn]; btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(80, 30, 200, 50); [btn.layer setBorderWidth:0]; btn.tag = 2; [btn setTitle:@"2" forState:UIControlStateNormal]; [btn addTarget:self action:@selector(detail:) forControlEvents:UIControlEventTouchUpInside]; btn.titleLabel.font = [UIFont fontWithName:@"Zapfino" size:14.0]; [scrollview addSubview:btn]; btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(80, 30, 200, 50); [btn.layer setBorderWidth:0]; btn.tag = 3; [btn setTitle:@"3" forState:UIControlStateNormal]; [btn addTarget:self action:@selector(detail:) forControlEvents:UIControlEventTouchUpInside]; btn.titleLabel.font = [UIFont fontWithName:@"Zapfino" size:14.0]; [scrollview addSubview:btn]; </code></pre> <p>this is the action which i am using. </p> <pre><code>-(IBAction)detail:(id)sender { detailViewController *detailvc =[[detailViewController alloc]initWithNibName:@"detailViewController" bundle:Nil]; detailvc.btntxt = btn.tag; NSLog(@"name of btn :%ld",(long)btn.tag); [self.navigationController pushViewController:detailvc animated:YES]; } </code></pre> <p>In nslog also i am getting the tab of 3rd button only please help me out regarding this issue...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload