Returning method object from inside block
问题 I am wondering how to do the following correctly: I have a method that is to return an NSData object. It gets the NSData object from a UIDocument . The NSData object can get large, so I want to make sure it is fully loaded before the response starts. I would therefore like to return the value of the method from within the block itself. So something like this: - (NSData*)getMyData { MyUIDocument *doc = [[MyUIDocument alloc] initWithFileURL:fileURL]; [doc openWithCompletionHandler:^(BOOL