I want to get comments for a photo from a web server. Server returns an array that includes comments. Is it possible to attach a block instead of comment array to NSMutableDictionary? I want the block to return the comment and insert it's value to dictionary.
I mean some think like this (but it gives compile errors):
NSArray* (^commentsBlock)(id responseObject) = ^(id responseObject){
return responseObject;
};
[self fetchCommentsForNode:[fileInfo objectForKey:@"nid"]
success: commentsBlock];
VDPhoto *photo = [VDPhoto photoWithProperties:
@{@"imageView": imageview,
@"title": [fileInfo objectForKey:@"title"],
@"comments" : commentsBlock,
}];
[photos addObject:photo];