Google Api 错误“多个名为 'initWithArray:' 的方法找到" [英] Google Api error "Multiple methods named 'initWithArray:' found"

查看:19
本文介绍了Google Api 错误“多个名为 'initWithArray:' 的方法找到"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用谷歌日历 API,但出现两个错误.

I am using the google calendar api and I am getting two errors.

  1. GTMGatherInputStream.m:25:13:找到多个名为initWithArray:"的方法

  1. 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 Xcode 7.0 运行 GM El capan.我尝试了多种不同的方法来解决它,但没有任何效果.我的代码不会编译.我该如何解决?

    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?

    推荐答案

    我认为 Google 将在不久的将来对此实施修复;与此同时,我们可以通过一些技巧来解决这些问题:

    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:

    1. change return [[[self alloc] initWithArray:dataArray] autorelease];

    return [[(GTMGatherInputStream*)[self alloc] initWithArray:dataArray] autorelease];

    改变

    #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 项目构建设置,并将 Apple LLVM 7.0 警告 Deprecated Functions 设置为 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.

    这篇关于Google Api 错误“多个名为 'initWithArray:' 的方法找到"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆