我正在努力使我的应用程序与iOS 10 beta兼容.但不幸的是,应用程序一开始就崩溃了.我已经检查了Main.storyboard中的所有IBoutlet和连接,这些都非常好.它也适用于iOS 9.3.2,即Xcode 7.3.
请帮忙.提前致谢.
我已经在我的捆绑包中添加了单个证书的以下代码.
(void)connection:(NSURLConnection *)connection
willSendRequestForAuthenticationChallenge:
(NSURLAuthenticationChallenge *)challenge
{
if ([challenge previousFailureCount] == 0)
{
identity = [self getClientCertificate];
CFArrayRef certs = [self getCertificate];
NSArray *myArray = (__bridge NSArray *)certs;
NSURLCredential *newCredential = [NSURLCredential credentialWithIdentity:identity
certificates:myArray persistence:NSURLCredentialPersistenceNone];
[challenge.sender useCredential:newCredential forAuthenticationChallenge:challenge];
}
else {
[[challenge sender] cancelAuthenticationChallenge:challenge];
}
}
(CFArrayRef)getCertificate
{
SecCertificateRef certificate = nil;
SecIdentityCopyCertificate(identity, &certificate);
SecCertificateRef certs[1] = {certificate};
CFArrayRef array = CFArrayCreate(NULL, (const void **) certs, 1, NULL);
SecPolicyRef myPolicy = SecPolicyCreateBasicX509();
SecTrustRef myTrust;
OSStatus status = SecTrustCreateWithCertificates(array, …Run Code Online (Sandbox Code Playgroud)