这几天我一直在搞砸。我是 xcode 的新手.. 但只是不明白为什么我不断收到此错误。我已经尝试过......我希望有人可以帮助我。感谢您的时间
- (void)longPressAction:(UILongPressGestureRecognizer *)gestureRecognizer
{
CGPoint touchLocation = [gestureRecognizer locationInView:self.webView];
NSString *javascript = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f).src", touchLocation.x, touchLocation.y];
NSString *imageUrl = [self.webView stringByEvaluatingJavaScriptFromString:javascript];
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageUrl]];
UIImage *image = [UIImage imageWithData:imageData];
// Show the editor
ImageEditorViewController *editView = [[ImageEditorViewController alloc] initWithImageAndSaveName:image saveName:[imageUrl lastPathComponent]];
[self.navigationController pushViewController:editView animated:YES];
}