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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:41:48+00:00 2026-05-26T19:41:48+00:00

Button doesn’t respond in viewForRow: UIView * rowView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 200,

  • 0

Button doesn’t respond in viewForRow:

UIView * rowView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 44)] autorelease];

UIButton* deleteButton = [[[UIButton alloc]init]autorelease];
deleteButton.frame = CGRectMake(200, 10, 20,20);
[deleteButton setImage:[UIImage imageNamed:@"IconTrash.png"] forState: UIControlStateNormal];
[deleteButton addTarget: self action:@selector(removeCellAtIndexPath:) forControlEvents: UIControlEventTouchUpInside];

UILabel *labelText = [[UILabel alloc]init];
labelText.text =  [NSString stringWithFormat:@"%@",[[localFlagNotes objectAtIndex:row] value]];
labelText.font = [UIFont fontWithName:@"Arial" size: 24];
labelText.frame = CGRectMake(0, 10, 200, 28);
labelText.backgroundColor = [UIColor clearColor];

[rowView addSubview:labelText];
[rowView addSubview:deleteButton];
[labelText release];
return rowView;

removeCellAtIndexPath doesn’t call after press button. Does anyone have some idea why and some solution?

I think button even not pressed only cell become active.

  • 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-26T19:41:49+00:00Added an answer on May 26, 2026 at 7:41 pm

    I find ways. just in

    - (UIView*)pickerView:(UIPickerView *)pickersView viewForRow:(NSInteger)row
              forComponent:(NSInteger)component reusingView:(UIView *)view
         {
               PickerCustomView * rowView = [[PickerCustomView alloc]initWithFrame:CGRectMake(5, 0, 310, 50) withText:[[localFlagNotes objectAtIndex:row] value]] ;
               rowView.delegate = self;
               return rowView;
         }
    

    Create custom View with button

    Like this

    - (id)initWithFrame:(CGRect)frame withText:(NSString*)text
    {
       self = [super initWithFrame:frame];
       if (self) 
    {
         deleteButton = [[UIButton alloc]init];
    
        [deleteButton setImage:[UIImage imageNamed:@"IconTrash"] forState: UIControlStateNormal];
        [deleteButton addTarget:self action:@selector(deleteButtonAction:) forControlEvents:UIControlEventTouchUpInside];
        deleteButton.frame = CGRectMake(250, 10, 35,35);
    
        textLabel = [[UILabel alloc]init];
        originText = text;
        NSString *trimmed = [text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
        textLabel.text =  trimmed;
        textLabel.font = [UIFont fontWithName:@"Arial" size: 24];
        textLabel.frame = CGRectMake(20, 10, 230, 28);
        textLabel.backgroundColor = [UIColor clearColor];
    
        [self addSubview:textLabel];
        [self addSubview:deleteButton];      
    
    }
    return self;
    

    }

    And use:

    -(void)deleteButtonAction:(id)sender
     {
         [delegate removeCellAtIndexPath:originText];
     }
    

    Or:

     -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    {
        UITouch *touch = [[event allTouches] anyObject];
        CGPoint location = [touch locationInView:touch.view];
    
        if ( (location.x > 10 && location.x < 38) && (location.y > 240 && location.y < 265)    )
         {
            [self deleteButtonAction:nil];
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIButton and a UIView. The View sits above the button, and
There is a blog post on Why Windows Mobile's X button doesn't close the
My application hangs. Pressing the home button doesn't return to the springboard anymore. Additionally
I have a search box that doesn't have a submit button, I need to
I'm trying to call the MyJavascriptFunction(arg1) from an asp button and it's doesn't work...
<script> $(#test_img).click(function() { alert(Hello); }); </script> But it doesn't matter what mouse button I'm
The button doesn't show in this layout(code below),image and textview are shown. I tried
My facebook like button doesn't appear in Firefox, Chrome and IE !! I tried
I think the code is self-explanatory, the button doesn't work, what am I doing
I just discovered that the iframe version of the Facebook Like button doesn't honor

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.