Iphone 从https url获取图像+;苹果手机
我想从iphone中的https url获取图像:- url如下所示:- 我在谷歌上做了一些工作,并从以下链接中找到了帮助:- http://www.iphonedevsdk.com/forum/iphone-sdk-development/80894-load-image-url.html 但这里显示的所有示例都是针对http的,而不是来自https的 有人能帮我吗。Iphone 从https url获取图像+;苹果手机,iphone,Iphone,我想从iphone中的https url获取图像:- url如下所示:- 我在谷歌上做了一些工作,并从以下链接中找到了帮助:- http://www.iphonedevsdk.com/forum/iphone-sdk-development/80894-load-image-url.html 但这里显示的所有示例都是针对http的,而不是来自https的 有人能帮我吗。 请了解如何执行此操作iOS上的URL加载系统对HTTP和HTTPS URL的工作原理相同。任何适用于HTTP URL的示例都
请了解如何执行此操作iOS上的URL加载系统对HTTP和HTTPS URL的工作原理相同。任何适用于HTTP URL的示例都应该适用于HTTPS。您可以使用framework谢谢您的回复。。。。。。 我找到了解决办法。 我是这样做的:-
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:strURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
[NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[[NSURL URLWithString:strURL] host]];
// [theRequest addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
// [theRequest setHTTPMethod:@"GET"];
NSURLConnection *theConnection = [[[NSURLConnection alloc] initWithRequest:theRequest delegate:self] autorelease];
if(theConnection) {
self.activeDownload = [[NSMutableData data] retain];
}
else {
NSLog(@"theConnection is NULL");
}
感谢您的回复,但https url是不受信任的url。我无法从该url检索图像。但是通过使用:-[NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[[NSURL URLWithString:strURL]host];我找到了解决办法