It seems that completion handler block is never invoked. Is that means the save fails? I po self.document.fileURL in console, which appears valid.
[self.document saveToURL:self.document.fileURL forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) {
// set breakpoint here, but it won't stop
[[[Fetcher alloc]init] fetchImageFromSring:HTTP_REQUEST inContext:self.document.managedObjectContext];
}];
The completion handler block should be invoked regardless of whether the save succeeded
About the completionHandler from apple
Have you put a breakpoint on this line to make sure it runs
EDIT
I believe the issue can be which type of debugger you are using. (from this SO question)
Make sure you are using
lldbEven if you don’t change debuggers, you could always verify the block is executed with
NSLog(@"block is running, save successfully - %d", success)