Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 谷歌Api错误“;名为'的多个方法;initWithArray:';“发现”;_Objective C_Swift_Api_Google Api_Xcode7 - Fatal编程技术网

Objective c 谷歌Api错误“;名为'的多个方法;initWithArray:';“发现”;

Objective c 谷歌Api错误“;名为'的多个方法;initWithArray:';“发现”;,objective-c,swift,api,google-api,xcode7,Objective C,Swift,Api,Google Api,Xcode7,我正在使用谷歌日历api,我得到两个错误 GTMGatherInputStream.m:25:13:找到多个名为“initWithArray:”的方法 #import "GTMGatherInputStream.h" @implementation GTMGatherInputStream + (NSInputStream *)streamWithArray:(NSArray *)dataArray { return [[[self alloc] initWithArray:dataAr

我正在使用谷歌日历api,我得到两个错误

  • GTMGatherInputStream.m:25:13:找到多个名为“initWithArray:”的方法

    #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”文件

    #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 capitan。我尝试了多种不同的方法来解决这个问题,但没有任何效果。我的代码无法编译。我该如何解决这个问题

    我认为谷歌将在不久的将来对此进行修复;与此同时,我们可以采取一些措施来解决这些问题:

  • 更改
    返回[[[self alloc]initWithArray:dataArray]autorelease]

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

  • 改变

    #ifndef GTM_USE_SESSION_FETCHER
    #define GTM_USE_SESSION_FETCHER 1
    #endif
    

  • 我必须在定义了
    GTM\u USE\u SESSION\u FETCHER
    的两个地方这样做


    最后一件事是转到GTL项目构建设置,并将Apple LLVM 7.0 warnings
    弃用函数设置为NO。通过这三个步骤,日历API在iOS9上成功编译。

    我还必须处理一个错误
    比较。。。不等于空指针始终为真

    这导致应用程序无法生成。不得不修改GTMOAuth2ViewControllerTouch.m的第340行和第1088行

    例如:


    [[[self alloc]initWithArray:dataArray]autorelease]中的self更改为
    GTMGatherInputStream
    。这对我有用:

    #import "GTMGatherInputStream.h"
    @implementation GTMGatherInputStream
    + (NSInputStream *)streamWithArray:(NSArray *)dataArray {
        return [[[GTMGatherInputStream alloc] initWithArray:dataArray] autorelease];
    }
    

    刚刚安装了Xcode 7更新,我也遇到了同样的问题。你找到解决办法了吗?我也有同样的问题。必须使用Xcode 6.4进行构建。(为Mac构建)我完成了所有这些步骤,但我遇到了一个新错误:“google api objectivec client/Source/HTTPFetcher/GTMHTTPFetcherLogging.m:793:59:'stringByAddingPercentEscapesUsingEncoding:'已弃用:首先在iOS 9.0中弃用-使用-stringByAddingPercentEncodingWithAllowedCharacters:,它始终使用推荐的UTF-8编码,以及为特定URL组件或子组件进行编码,因为每个URL组件或子组件对哪些字符有效有不同的规则。“我已经查看了错误,但没有任何结果。有任何帮助吗?通过添加百分比EscapeSusingEncoding to:
    NSString*escapedResponseFile=[responseDataFileName stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]
    您是否转到GTL项目生成设置,并将Apple LLVM 7.0 warnings弃用函数设置为否?该步骤为我修复了弃用警告。我现在已经完成了这两个步骤。我有以下内容:google api objectivec client/Source/HttpFetcherLogging/GTMHTTPFetcherLogging.m:797:112:不兼容的整数到指针转换发送“NSStringEncoding”(又名“未签名长”)对于类型为“NSCharacterSet*_Nonnull”的参数,我尝试了所有包含int的NSStringEncoding,但没有一个有效。我真的没有得到。帮助?现在修复了以下问题:google api objectivec client/Source/HTTPFetcher/GTMHTTPFetcherLogging.m:797:112:不兼容的整数到指针转换发送“NSStringEncoding”(也称为“unsigned long”)到类型为“NSCharacterSet*_Nonnull”的参数我尝试了每一个包含Int的NSStringEncoding,但没有一个有效。帮助?
      // CGP; 9/30/15; took out "&" before kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
      //if (accessibility == NULL
      //    && &kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly != NULL) {
      if (accessibility == NULL
            && kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly != NULL) {
        accessibility = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly;
      }
    
    #import "GTMGatherInputStream.h"
    @implementation GTMGatherInputStream
    + (NSInputStream *)streamWithArray:(NSArray *)dataArray {
        return [[[GTMGatherInputStream alloc] initWithArray:dataArray] autorelease];
    }