0

I'm new to Reactive Cocoa and I'm wondering if someone could help me with this problem:

Here's the code snippet causing me trouble:

[[[self getFormItemAttachmentHeaders:listName
                      topListItemID:form.topListItemID
                              form:form
 ] map:^id(NSMutableArray* value) {
    NSArray* attachmentHeaders = [value copy];
    return attachmentHeaders;
    }
  ] subscribeNext:^(NSArray* attachmentHeaders) {
    return [self uploadFormItemAttachments:pendingAttachments
                  attachmentHeaders:attachmentHeaders
                               form:form];
    }
 ];

This code is called from a RACsignal object in the same method defined as such:

  RACSignal* batchSignal = [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
    [pendingAttachments enumerateObjectsUsingBlock:^(SEFSManagedAttachment* pendingImage, NSUInteger idx, BOOL *stop) {

The following line of code:

return [self uploadFormItemAttachments:pendingAttachments
                      attachmentHeaders:attachmentHeaders
                                   form:form];

Generates the error:

Incompatible block pointer types sending 'RACSignal *(^)(NSArray *__strong)' to parameter of type 'void (^)(__strong id)'
user1309226
  • 739
  • 1
  • 10
  • 31

1 Answers1

0

The reason for the error is because subscribeNext block returns void and by placing a return will generate the incompatibility with the block signature.

user1309226
  • 739
  • 1
  • 10
  • 31