我正在关注这里的教程,其中包括带有通知的事件管理和所有内容。现在的问题是我在以下代码中遇到错误
我的 .h 文件
#import <UIKit/UIKit.h>
#import <EventKit/EventKit.h>
@interface ViewController : UIViewController
- (IBAction) NewEvent:(id)sender;
@end
我的 .m 文件
#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
附加信息: 我已经添加了框架但仍然出现错误,如代码中所示。代码名称是
在“eventstore”类型的对象上找不到属性“title”
先感谢您 :)