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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:36:42+00:00 2026-05-16T06:36:42+00:00

Apple’s documentation on UITableView discusses how to add/edit/delete rows, but it doesn’t discuss adding/editing/deleting

  • 0

Apple’s documentation on UITableView discusses how to add/edit/delete rows, but it doesn’t discuss adding/editing/deleting sections is detail, specially with respect to the UI. In case of add/delete rows, you can apply “add” and “delete” styles on the row using:

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath;

However, there is no such method for sections (that i know of), which can be used to show visual controls to the user for adding “+” or deleting “-” sections. I can add a new section using the logic used for new row, however, I’m not sure how to go about deleting the whole section (or allowing the user to edit section e.g. section heading). How should i go about deleting the whole section?

Background:
I’m working on a Core Data based application. I have a one to many relationship between entities.

Entity r (root)   <-->> Entity p (parent),
Entity p (parent) <-->> Entity c (child)

When user creates a parent record (entity p), fixed set of child records are automatically created (entity c). In the UI, I’m showing basic information of parent (entity p) in the header e.g. title, and the associated child records (entity c) as section rows, and some summary in the footer. For some logical reasons, i can’t opt for drill-down approach (to avoid adding/removing sections).

  • 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-16T06:36:42+00:00Added an answer on May 16, 2026 at 6:36 am

    Edited:

    Since you can define custom views for sections, your best bet is to replace the existing one with your own UIView which, when swiped (using gestures) would delete the section. You could probably imitate that red delete button to the right, or you could just have a UIAlertView with confirmation when the user swipes on a section.

    You’d use tableView:deleteSections:withRowAnimation: to delete the section.

    The following SO question delves into the subject: UITableView: deleting sections with animation

    Was:

    Firstly,

    // UITableView.h:311...
    - (void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation;
    - (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation;
    - (void)reloadSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
    

    Secondly,

    UIKIT_EXTERN_CLASS @interface UITableView : UIScrollView <NSCoding> {
    // ... 
    NSInteger                   _swipeToDeleteSection;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.