xcodeobjectekeventstore

the property 'title' was not found on object of type "eventstore"


I am following a tutorial on here which consist of Event management with notifications and all. Now the problem is that i am getting errors in the following Codes

My .h file

#import <UIKit/UIKit.h>
#import <EventKit/EventKit.h>


@interface ViewController : UIViewController

- (IBAction) NewEvent:(id)sender;


@end

My .m file

#import "ViewController.h"
#import <EventKit/EventKit.h>

@interface ViewController ()

@end

@implementation ViewController

- (IBAction) NewEvent:(id)sender {

    EKEventStore *eventDB = [[EKEventStore alloc] init];
    EKEventStore *myEvent = [EKEvent eventWithEventStore:eventDB];

    myEvent.title = @"New Event"; // <-- Errors are appearing hear as shown in the title.


}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

@end

Additional information: i have already added the frame work but still getting error as show above in the code. The name of the code is

the property 'title' was not found on object of type "eventstore"

Thank you in advance :)


Solution

  • You'll want to double-check that myEvent is the right type (EKEvent * rather than EKEventStore *) and that you're actually trying to set the title on myEvent rather than eventDB. The error you posted indicates that you're setting title on an event store, instead of just an event.