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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:41:01+00:00 2026-05-29T04:41:01+00:00

I have NSMutableArray day which contain (6 NSMutable arrays) arrays contain class Lesson{ NSString

  • 0

I have NSMutableArray “day” which contain (6 NSMutable arrays) arrays contain

class Lesson{
    NSString *time1;
    NSString *time2;
    NSString *predmet;
    NSString *namPrepod;
    NSString *zamet;
}

I have function to get current week, day, lesson

-(Lesson *)lessonInWeek:(int)week inDay:(int)day lessonNumber:(int)lNumber
{
    Week *currentWeek = nil;
    if(week)    
        currentWeek = nechetNedel;
    else        
        currentWeek = chetNedel;

    NSMutableArray *dayArray = [currentWeek.days objectAtIndex:day];
    Lesson *lesson = [dayArray objectAtIndex:lNumber];

    return lesson;
}

with this function I show in

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
......
 Lesson *item = [[Singleton sharedInstance] lessonInWeek:segmentedControl.selectedSegmentIndex inDay:indexPath.section lessonNumber:indexPath.row];

    ....
    time1.text= item.time1;
    ....

    time2.text= item.time2;
    ....
    predmet.text=item.predmet;
    .....
    namePrepod.text=item.namPrepod;
    ......
    zamet.text=item.zamet;
    ....

who can I delete a row with this function without the use of ?

if(segmentedControl.selectedSegmentIndex==0)
if(section==1)
......

The function need to edit for delete a row.

  • 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-29T04:41:03+00:00Added an answer on May 29, 2026 at 4:41 am

    Add a deleteLessonInWeek:inDay:lessonNumber: to your singleton class, and call it from your tableView:commitEditingStyle:forRowAtIndexPath: implementation:

    - (void) tableView:(UITableView*)tableView
        commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
        forRowAtIndexPath:(NSIndexPath*)indexPath {
        if (editingStyle == UITableViewCellEditingStyleDelete) {
            [[Singleton sharedInstance] deleteLessonInWeek:segmentedControl.selectedSegmentIndex inDay:indexPath.section lessonNumber:indexPath.row];
        }
    }
    

    The implementation iside the Singleton could use the same clean pattern of looking up day array, then the lesson inside its day, and then deleting the requested item:

    -(void)deleteLessonInWeek:(int)week inDay:(int)day lessonNumber:(int)lNumber {
        // Choose odd or even week:
        Week *currentWeek = week ? nechetNedel : chetNedel;
        NSMutableArray *dayArray = [currentWeek.days objectAtIndex:day];
        [dayArray removeObjectAtIndex:lNumber];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some NSMutableArray in tableView which contain class Lesson @interface Lesson : NSObject
I have NSMutableArray days which contain 7 NSMutableArrays,7 NSMutableArrays contain class Lesson. @interface Lesson
I have got 6 NSMutableArray(monday,tuesday...saturday) which I add to NSMutableArray "day" I doing in
I have a class that subclasses NSMutableArray. I init it using: MyClass class =
I have four arrays as follows: toArray = [[NSMutableArray alloc] initWithObjects:@to 1,@to 2,@to 3,@to
I have a NSMutableArray which i am initializing from a plist with strings. but
I have an NSMutableArray called myObjectArray which contains and array of NSObjects called myObject.
Assuming I have an NSMutableArray which is loaded from file: searchTermsArray = [[NSMutableArray alloc]
I have been working on an app all day which has been working fine
I have a NSMutableArray which repeatedly will be filled with the changing contents of

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.