有人能帮我理解一下这种罕见且随机的崩溃吗?有没有办法修复此问题而不会重现?线程 0 名称:线程 0 崩溃:0 libdispatch.dylib
有人能帮我理解一下这种罕见且随机的崩溃吗?有没有办法修复这个问题而不让它重现?
Thread 0 name:
Thread 0 Crashed:
0 libdispatch.dylib 0x00000001b2d7e538 _dispatch_sync_f + 4 (queue.c:1898)
1 Security 0x00000001b372d0d8 SecTrustGetCertificateAtIndex + 244 (SecTrust.c:0)
2 PK9 0x0000000102d63124 __61+[CertificateUtils certificatesFromTrust:options:completion:]_block_invoke + 88 (CertificateUtils.m:201)
3 CoreFoundation 0x00000001aadb51b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 (CFRunLoop.c:1805)
4 CoreFoundation 0x00000001aadb39ac __CFRunLoopDoBlocks + 356 (CFRunLoop.c:1847)
5 CoreFoundation 0x00000001aadb1888 __CFRunLoopRun + 812 (CFRunLoop.c:2953)
6 CoreFoundation 0x00000001aadb1478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7 GraphicsServices 0x00000001ee30a4f8 GSEventRunModal + 164 (GSEvent.c:2196)
8 UIKitCore 0x00000001ad1db360 -[UIApplication _run] + 888 (UIApplication.m:3685)
9 UIKitCore 0x00000001ad1da99c UIApplicationMain + 340 (UIApplication.m:5270)
10 PK9 0x0000000102e5dfe8 main + 68 (main.m:15)
11 dyld 0x00000001cdae9dcc start + 2240 (dyldMain.cpp:1269)
发生崩溃的函数:
+ (void)certificatesFromTrust:(SecTrustRef)trust options:(CertificateOptions)options completion:(void (^)(NSArray *))completion
{
if (trust == NULL) {
completion(nil);
}
else {
// trust needs to be evaluated prior to attempting to retrieve the certs
CFIndex count = SecTrustGetCertificateCount(trust);
[self evaluateTrust:trust completion:^(OSStatus status, SecTrustResultType result) {
NSMutableArray *certs = [NSMutableArray arrayWithCapacity:(NSInteger)count];
for (CFIndex i = 0; i < count; i++) {
SecCertificateRef cert = SecTrustGetCertificateAtIndex(trust, i);
if (cert != NULL) {
// Extract certificate data
NSData *certData = CFBridgingRelease(SecCertificateCopyData(cert));
if (certData != nil && (options & CertificateOptionsRemoveRootCertificates) && count > 1) {
// We were told to strip all anchor certificates, so only keep this one if it's issued by someone else (and not the only cert, i.e. self-signed)
const unsigned char *certDataBytes = (const unsigned char *)[certData bytes];
X509 *x509Cert = d2i_X509(NULL, &certDataBytes, [certData length]);
NSString *subjectCN = X509CertificateGetCommonName(X509_get_subject_name(x509Cert));
NSString *issuerCN = X509CertificateGetCommonName(X509_get_issuer_name(x509Cert));
X509_free(x509Cert);
if ([subjectCN isEqualToString:issuerCN]) {
certData = nil; // do not add root certificates
}
}
if (certData != nil) {
// create a copy of the certificate and add it to the array transferring ownership to ARC
cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)(certData));
[certs addObject:CFBridgingRelease(cert)];
}
}
}
completion(certs);
}];
}
}
我有一个 NSString *htmlString,它在 HTML 中显示一个按钮来打开 Telegram。我曾尝试加入 Telegram
我有一个 NSString *htmlString
在 HTML 中显示按钮来打开 Telegram。
我已尝试过 <a href='https://t.me/*********official' class='btn btn-success btn-block'>Join on Telegram</a>
但这只是直接在应用程序中打开。
我的第二个理论是尝试 <a href='window.open('https://t.me/*********official')' class='btn btn-success btn-block'>Join on Telegram</a>
相同的结果。如何在 Safari 中使用 Objective-C htmlString 打开此链接,而不是直接在应用程序中打开?