2017-09-23 4 views
3
私はXcodeの9

ブレーントリーエラー9

@defaultFirst変数は、次のエラートリガさにアップグレードので、私は私のBTAPIClient.mファイルに新しいエラーを取得してい

オブジェクトのをタイプ 'NSNumber *'は、辞書値 'NSString *'と互換性がありません。

次のコード行で起こっている:私はこのエラーを文書化し、誰を見つけることができませんでしたparameters:@{@"default_first": @(defaultFirst)}

。私はコードのいずれにも変更を加えなかった、これは新鮮なCocoapodsのインストールです。

- (void)fetchPaymentMethodNonces:(BOOL)defaultFirst completion:(void (^)(NSArray <BTPaymentMethodNonce *> *, NSError *))completion { 
if (!self.clientToken) { 
NSError *error = [NSError errorWithDomain:BTAPIClientErrorDomain code:BTAPIClientErrorTypeNotAuthorized userInfo:@{ NSLocalizedDescriptionKey : @"Cannot fetch payment method nonces with a tokenization key", NSLocalizedRecoverySuggestionErrorKey : @"This endpoint requires a client token for authorization"}]; 
    if (completion) { 
     completion(nil, error); 
    } 
    return; 
} 

[self GET:@"v1/payment_methods" 
     parameters:@{@"default_first": @(defaultFirst), 
         @"session_id": self.metadata.sessionId} 
     completion:^(BTJSON * _Nullable body, __unused NSHTTPURLResponse * _Nullable response, NSError * _Nullable error) { 
      dispatch_async(dispatch_get_main_queue(), ^{ 
       if (completion) { 
        if (error) { 
         completion(nil, error); 
        } else { 
         NSMutableArray *paymentMethodNonces = [NSMutableArray array]; 
         for (NSDictionary *paymentInfo in [body[@"paymentMethods"] asArray]) { 
          BTJSON *paymentInfoJSON = [[BTJSON alloc] initWithValue:paymentInfo]; 
          BTPaymentMethodNonce *paymentMethodNonce = [[BTPaymentMethodNonceParser sharedParser] parseJSON:paymentInfoJSON withParsingBlockForType:[paymentInfoJSON[@"type"] asString]]; 
          if (paymentMethodNonce) { 
           [paymentMethodNonces addObject:paymentMethodNonce]; 
          } 
         } 
         completion(paymentMethodNonces, nil); 
        } 
       } 
      }); 
}]; 

答えて

2

私はCocoapodsを使用したプロジェクトで同じ問題がありました。

はあなたの依存関係を更新していないことを確認してください:

  • 近くのXcode
  • 明確ポッドフォルダ
  • pod installないupdate
  • ビルド
+0

感謝を実行します!私はまた、エラーを再現できるBraintreeに連絡し、すぐに修正をリリースすると約束した –