Return value from inside block (Objective-C)
问题 I've been trying to get a value from inside a block for a few hours now, I can't understand how to use the handlers on completion and literally everything. Here's my code: + (void)downloadUserID:(void(^)(NSString *result))handler { //Now redirect to assignments page __block NSMutableString *returnString = [[NSMutableString alloc] init]; //'__block' so that it has a direct connection to both scopes, in the method AND in the block NSURL *homeURL = [NSURL URLWithString:@"https://mistar.oakland