【发布时间】:2014-06-28 05:42:59
【问题描述】:
我一直在使用 Xcode(iOS 开发)上的 google calendar API,到目前为止,我已经能够将我的 xcode 项目链接到我的 google 帐户,并且基于本教程: http://code.tutsplus.com/tutorials/ios-sdk-working-with-google-calendars--mobile-19155
我终于可以在我的日历中发布快速添加事件了。但是,我在发布特定时间的活动时遇到问题。
我根据以下内容构建我的事件字符串: https://support.google.com/calendar/answer/36604?hl=en
_strEventTextToPost = [NSString stringWithFormat:@"%@ %d/%d/%d at %d:%d", _strEvent, [dateComponents day], [dateComponents month], [dateComponents year], [dateComponents hour] , [dateComponents 分钟]];
并使用 googleOauth 类发布它
[_googleOAuth callAPI:apiURLString withHttpMethod:httpMethod_POST postParameterNames:[NSArray arrayWithObjects:@"calendarId", @"text", nil] postParameterValues:[NSArray arrayWithObjects:[_dictCurrentCalendar objectForKey:@"id"], _strEventTextToPost, nil]]; NSLog(@"%@",[NSArray arrayWithObjects:[_dictCurrentCalendar objectForKey:@"id"], _strEventTextToPost, nil]);
当我运行应用程序时,事件会发布在日历中,但作为全天事件,我尝试更改字符串顺序,但始终显示没有小时/分钟。
任何补充信息请在下方评论,谢谢!我现在很困!
【问题讨论】:
标签: objective-c google-api google-calendar-api