我正在使用方法openURL:options:completionHandler:,事实证明在iOS 10中工作正常,但我也对我的应用程序感兴趣与旧的iOS 9兼容,但xcode给了我一个
NSException:
-[UIApplication openURL:options:completionHandler:]:
Run Code Online (Sandbox Code Playgroud)
无法识别的选择器发送到实例有什么办法让它在iOS 9中也可以工作吗?感谢可能的回复!
如果我使用下面的代码,数据将为零
dispatch_async(dispatch_get_global_queue(0,0), ^{
UIImage *img = [[UIImage alloc] init];
NSData * data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString:@"http://www.manipalgrocer.com/image/catalog/BANNER/sweets.jpg"]];
img = [UIImage imageWithData: data];
dispatch_async(dispatch_get_main_queue(), ^{
menuCell.imgMenu.image = img;
});
});
Run Code Online (Sandbox Code Playgroud)
但是,如果我使用以下代码,我将在我的 menuCell 中获取图像
dispatch_async(dispatch_get_global_queue(0,0), ^{
UIImage *img = [[UIImage alloc] init];
NSData * data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString:@"https://www.fooodzapp.com/image/catalog/JUST%20CHILL/Justchill%20(1).png"]];
img = [UIImage imageWithData: data];
dispatch_async(dispatch_get_main_queue(), ^{
menuCell.imgMenu.image = img;
});
});
Run Code Online (Sandbox Code Playgroud)
如果有人知道如何解决此问题,请回复。提前致谢