0

私はここで、通知とすべてを含むイベント管理で構成されるチュートリアルに従っています。今問題は私が次のコードでエラーを取得していることです

私の.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」が見つかりませんでした

前もって感謝します :)

4

1 に答える 1

0

(ではなく)myEvent正しいタイプであり、実際には。ではなくタイトルを設定しようとしていることを再確認する必要があります。投稿したエラーは、単なるイベントではなく、イベントストアに設定していることを示しています。EKEvent *EKEventStore *myEventeventDBtitle

于 2012-09-04T18:09:17.680 に答える