在Developer Library的幫助下,我嘗試使用EventKit和EventKitUI框架。我遇到了很早的路障。我已複製並粘貼code from the library found here。我在ViewController的導航欄中添加了一個名爲'AddEventViewController'的視圖控制器,我使用這段代碼來調用它。在'AddEventViewController'對象上沒有找到屬性'delegate'
- (IBAction)add:(id)sender {
AddEventViewController *addController = [[AddEventViewController alloc]
init];
addController.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:addController];
[self presentViewController:navigationController animated:YES completion: nil];
}
誤差顯示上線:addController.delegate = self;
該代碼被從庫直複製。如果可能有幫助,我使用Xcode 4.2和Storyboard。
UPDATE: 這是AddEventViewController.h:
#import <UIKit/UIKit.h>
@interface AddEventViewController : UIViewController
@end
你要告訴我,我創造了這個視圖控制器不正確?請解釋一下,爲什麼只是不「如何」,如果你會這麼好?
你確定你的'AddEventViewController'實際上有'委託'屬性嗎?請發佈它的聲明。 – Yuras 2012-01-30 22:33:05