trying to send the following message
- (NSArray *)callSwaggerwithStart:(NSNumber *)start andCount:(NSNumber *)count
{
[api messageWithCompletionBlock:start count:count filter:@"image" completionHandler:^(CustomResponse *output, NSError *error) {
if (!error) {
return [NSArray arrayWithArray:[[output toDictionary] valueForKey:@"items"]];
} else {
NSLog(@"ERROR IN CallApi, %@", &error);
}
}];
return nil;
}
I get the following errors:
Incompatible block pointer types
Control may reach end of non-void block
The block is from an Api class, and I would like to create a method since it is used multiple times in one controller. What is keeping the code from being able to return the nested NSArray value?
callSwaggerwithStart...method have a return value? It's pointless when dealing with a asynchronous block that won't return data until long after the method returns. You need to rethink how this works. - rmaddy