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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:51:00+00:00 2026-06-13T06:51:00+00:00

I have made a custom tableviewcell and override the method – (void) setEditing:(BOOL)editing animated:(BOOL)animated

  • 0

I have made a custom tableviewcell and override the method
–(void) setEditing:(BOOL)editing animated:(BOOL)animated
so as to hide a UISwitch for the editing mode.

This is my code

-(void) setEditing:(BOOL)editing animated:(BOOL)animated
{
    [super setEditing:editing animated:animated];

    if (animated==YES) {
        // With animation
        if (editing == NO) {
            // Editing stopped
            [UIView animateWithDuration:0.3
                             animations:^{
                                  [self.alarmSwitch setAlpha:1.0];
                             }];
            [self.alarmSwitch setEnabled:YES];
        } else {
            // Editing started
             [UIView animateWithDuration:0.3 
                             animations:^{
                                  [self.alarmSwitch setAlpha:0.0];
                             }];
            [self.alarmSwitch setEnabled:NO];
        }
    } else {
        // Without animation
        // .................
    }
}

In ios 5.0 this worked. From ios 5.1 and later it stopped showing again the alarmSwitch. Here are some screenshots.

1) EDITING MODE

enter image description here

2) AFTER EDITING (IOS 5.0)

enter image description here

3) AFTER EDITING (IOS 5.1 and later)

enter image description here

If i scroll up and then scroll down (so as to redraw the cell) the switch is presented again. Does anybody have any idea why this could happen? It is strange that in iOS 5.0 worked like a charm and now it doesn’t work.

  • 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-13T06:51:02+00:00Added an answer on June 13, 2026 at 6:51 am

    The problem seems to be the interaction of the

    [self.alarmSwitch setEnabled:NO];
    

    and the setAlpha animation.

    The simplest way to solve the problem is to call the setEnabled line inside the animation block before setAlpha like this:

    [UIView animateWithDuration:0.3
                             animations:^{
                                 [self.alarmSwitch setEnabled:NO];
                                 [self.alarmSwitch setAlpha:0.0];
                             }];
    

    By the way, why are you even setting the enabled property to NO? Setting the alpha property to 0 should be enough.

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

Sidebar

Related Questions

I have made the custom dialog for my application. @Override public void onCreate(Bundle savedInstanceState)
I have made a custom NSView and have implemented the keyDown: method. However, when
I have made a custom UISwitch (from this post) . But the problem is,
I have a tableView based app and I made a custom TableViewCell that have
I have made a custom input method for formtastic, it is designed to work
I have made my custom In extension method as shown below: public static class
I have cells in UITableView , I have made custom frame for the label
I have made a custom form in a module where I have used a
I have made a custom formwizard and incorporated it into my admin interface. Basically
I have made my custom module in magento, in which I have set discount

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.