【问题标题】:How i add Event to default calendar in iOS Module through Titanium?如何通过 Titanium 将事件添加到 iOS 模块中的默认日历?
【发布时间】:2012-08-13 12:34:50
【问题描述】:

我想用 Titanium appcelerator 制作 iOS 模块。我已将 app.js 文件连接到 xCode。这一切都很好。 我可以发送数据并获得响应。但是当我在默认日历中编写添加事件的代码时,它就崩溃了

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 并导入。

【问题讨论】:

    标签: titanium titanium-modules


    【解决方案1】:

    您需要更改您的 module.xconfig 文件以包含此行。

    OTHER_LDFLAGS=$(inherited) -framework EventKit
    

    这会通知应用程序将 EventKit 框架构建到主二进制文件中,仅将其包含在您的模块 XCode 项目中是不够的。 Check this part of the docs for more information.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多