AWSを使用しており、AWSTaskのヘルプが必要です。基本的には、読みやすさのための変数として宣言したいいくつかの非常に大きなブロックがあります。例えばAWSTaskの使用、ブロックを変数として宣言する方法
http://docs.aws.amazon.com/mobile/sdkforios/developerguide/awstask.html
コードのこのビット:
[task continueWithSuccessBlock:^id(AWSTask *task) {
//do something
return nil;
}];
私はローカル変数としてブロックを抽出するにはどうすればよいですか?エラー与え
void (^myBlock)(AWSTask *task) = ^(AWSTask *task){ //do something return nil; }; [task continueWithSuccessBlock:myBlock];
:ここ
- (AWSTask *)continueWithSuccessBlock:(AWSContinuationBlock)block;
が関与typedefである:ここでは
Incompatible block pointer types initializing 'void (^__strong)(AWSTask *__strong)' with an expression of type 'void *(^)(AWSTask *__strong)'
は、メソッドの宣言であるこれは私がこれまで持っているものです。
typedef __nullable id(^AWSContinuationBlock)(AWSTask<ResultType> *task);
すべてのポインターをいただければ幸いです!
'AWSContinuationBlock _Nonnull'(別名id _Nullable(^)(AWSTask)型のパラメータに 'void(^ const __ strong)(AWSTask * __ strong)'を送信する互換性のないブロックポインタ型が、 * _Nonnull __strong) ') –
Peter
@Peter(^ const __strong)がどこから来ているのだろうか。また、どのXcodeを実行していますか? – Sheamus
Xcode 7.3.1とポッド 'AWSCore'、 '2.4.7' – Peter