1
我开发了一个使用WatchKit 2的应用程序。 我必须从iOS设备传输图像才能观看。我发送了图片网址。 这是我值班伸出端代码,我过去常常把我的WKInterfaceImage图像:WatchKit没有下载图片
NSError *error = nil;
NSData * dataq = [NSData dataWithContentsOfURL:[NSURL URLWithString:"url string"] options:NSDataReadingMappedAlways error:&error];
UIImage *img = [UIImage imageWithData:dataq];
[cell.babyImage setImage:formattedImage];
在模拟器(手表模拟器,观看模拟器),它的工作原理,但在实际设备(iPhone和手表)我得到错误:
错误=
错误域= NSCocoaErrorDomain代码= 256 “文件‘image.jpg的’无法打开”。用户信息= {NSURL = https://“图片url”}