Hi, I'm creating a calendar application. I am using the EKeventEditViewController to add events to my application. The problem is that the title of the sheet cannot be modified. When I change a title, the console shows that the title has changed. However, the simulator still displays the previous title; "New Event". How can I fix it?
void (^showEventEditingController)(EKEvent *) = ^(EKEvent * event){
EKEventEditViewController *controller = [[EKEventEditViewController alloc] init];
controller.event = event;
controller.eventStore = [self getEventStoreInstance];
controller.editViewDelegate = self;
NSLog(@"%@", controller.title); // "New Event"
controller.title = @"My Custom title";
NSLog(@"%@", controller.title); // "My Custom title"
[self assignNavbarColorsTo:controller.navigationBar];
[self presentViewController:controller];
NSLog(@"%@", controller.title); // "My Custom title"
};
This is how I do it in my app - I have to get the title of the navigation bar and change that:
controller.title = @"New Title";
NSArray *array = controller.navigationBar.items;
UINavigationItem *titleItem = array.firstObject;
titleItem.title = @"New Title";
See if that works for you.