Delete Rows (All-day,Repeat and URL) Permanetally From EKEventEditViewController

104 views Asked by At

I Create an Event on Calendar, so i used the code that was provided by Apple sample code and i use EkEventViewController, all do work fine. but i want to customise EKEventViewController, and Delete these Rows -All-day,Repeat and URL when we create new Event view occurs.

http://stackoverflow.com/questions/14813240/how-to-customise-ekeventeditviewcontroller

in this link i customise the EKEventEditViewController but when i refresh this view automatically these Rows are appearing. so i want to permanently delete these ROWS. please help me.

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
if ([viewController isKindOfClass:[UITableViewController class]]) {

    UITableView *tableView = ((UITableViewController *)viewController).tableView;

    for (NSInteger j = 0; j < [tableView numberOfSections]; ++j)
    {
        for (NSInteger i = 0; i < [tableView numberOfRowsInSection:j]; ++i)
        {
            UITableViewCell *cell = [tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:j]];

            NSLog(@"cell => %@, row => %d, section => %d", cell.textLabel.text, i, j);

            if([cell.textLabel.text isEqualToString:@"Alert"]) {
                [cell removeFromSuperview];
            } else if(j == 5) { // If URL Field
                [cell removeFromSuperview];
            }
        }
    }
}

}

and if i want to add new row than how i can add.

1

There are 1 answers

1
Simon On BEST ANSWER

You can't. Not only that, but the answer given to your other question won't work in later versions of iOS. Controllers like EKEventEditViewController are increasingly being implemented as remote view controllers which are controlled by a separate process and which cannot be modified from within your app.