谷歌API错误"名为“initWithArray:”多种方法找到" [英] Google Api error "Multiple methods named 'initWithArray:' found"
问题描述
我使用的是谷歌日历API和我得到两个错误。
I am using the google calendar api and I am getting two errors.
-
GTMGatherInputStream.m:25:13:命名为initWithArray:多种方法找到
GTMGatherInputStream.m:25:13: Multiple methods named 'initWithArray:' found
#import "GTMGatherInputStream.h"
@implementation GTMGatherInputStream
+ (NSInputStream *)streamWithArray:(NSArray *)dataArray {
return [[[self alloc] initWithArray:dataArray] autorelease]; //error on this line
}
GTMOAuth2Authentication.h:31:11:'GTMSessionFetcher.h找不到文件
GTMOAuth2Authentication.h:31:11: 'GTMSessionFetcher.h' file not found
#if GTM_USE_SESSION_FETCHER
#import "GTMSessionFetcher.h" //GTMSessionFetcher.h file not found error
#else
#import "GTMHTTPFetcher.h"
#endif // GTM_USE_SESSION_FETCHER
我已经在网上随处可见的研究和错误我都一无所获。我正在GM埃尔卡皮坦与通用X $ C $ 7.0Ç。我试图解决它,并没有奏效多种不同的方式。我的code将无法编译。我该如何解决这个问题?
I have researched the error everywhere online and I have found nothing. I am running GM El capitan with GM Xcode 7.0. I Have tried multiple different ways on solving it and nothing has worked. My code will not compile. How do I fix this?
推荐答案
我认为谷歌将实行定为这在不久的将来;在此期间,我们可以做一对夫妇的黑客来解决这些问题:
I assume Google is going to implement a fix for this in the near future; in the meantime, we can do a couple of hacks to get around those issues:
-
改变
返回[[[自我页头] initWithArray:dataArray中]自动释放];
到
返回[[(GTMGatherInputStream *)[自行页头] initWithArray:dataArray中]自动释放];
改变
#ifndef GTM_USE_SESSION_FETCHER
#define GTM_USE_SESSION_FETCHER 1
#endif
到
#ifndef GTM_USE_SESSION_FETCHER
#define GTM_USE_SESSION_FETCHER 0
#endif
我不得不做这两个地方 GTM_USE_SESSION_FETCHER
定义。
I had to do this in two places where GTM_USE_SESSION_FETCHER
was defined.
最后一件事,是去到GTL项目构建设置,以及苹果LLVM 7.0警告德precated功能
为NO。有了这些3个步骤的日历API编译成功上iOS9。
One final thing, was to go to the GTL project build settings, and set Apple LLVM 7.0 warnings Deprecated Functions
to NO. With these 3 steps the Calendar API compiles successfully on iOS9.
这篇关于谷歌API错误"名为“initWithArray:”多种方法找到"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!