2012-08-08 44 views
1

我想用Titanium appcelerator製作iOS模塊。我已將app.js文件連接到xCode。每一個工作都很好。 我可以發送數據並得到迴應。但是,當我在默認日曆編寫代碼添加事件,然後這是墜毀如何通過Titanium將事件添加到iOS模塊中的默認日曆?

EKEventStore *eventStore1 = [[EKEventStore alloc] init]; 
EKEvent *event = [EKEvent eventWithEventStore:eventStore1]; 
event.title  = @"EVENT TITLE 4"; 
event.notes  = @"NOtes"; 
event.startDate = [[NSDate alloc] init]; 
event.endDate = [[NSDate alloc] initWithTimeInterval:600 sinceDate:event.startDate]; 

[event setCalendar:[eventStore1 defaultCalendarForNewEvents]]; 
NSError *err; 
[eventStore1 saveEvent:event span:EKSpanThisEvent error:&err]; 
NSLog(@" Error is %@",err); 

我該如何解決這個問題? 這是錯誤消息

output = run.run(args,False,False,o) 
[DEBUG] File "/Users/mac03/Library/Application Support/Titanium/mobilesdk/osx/2.0.2.GA/iphone/run.py", line 41, in run 
[DEBUG] sys.exit(rc) 
[DEBUG] SystemExit: 65 
[ERROR] Build Failed. See: /var/folders/5s/3wmzx34548d9jnj7z7v1ylc40000gn/T/mLmdFS2ti/test/build/iphone/build/build.log 
mac03:test mac03$ titanium run 

我有加Eventkit.framework也進口。

回答

0

你需要改變你的module.xconfig文件,加入這一行。

OTHER_LDFLAGS=$(inherited) -framework EventKit 

此通知打造EventKit框架到主二進制應用程序,它是不夠的只是把它列入你的模塊XCode項目。 Check this part of the docs for more information.

+0

感謝這工作非常感謝... – MRT 2012-08-13 05:16:29

相關問題