我每隔几个小时就会看到几十个崩溃的应用程序,仅在iOS 11中.堆栈跟踪没有帮助,我也没有任何线索,因为其余的线程在每个崩溃日志中都做了一些完全不同的事情.因此,我无法弄清楚究竟是什么触发它.其他人看到这个?
它似乎总是这样:
TCPIOConnection::_handleTLSEvent(nw_tls_context*, tls_handshake_message_t, void () block_pointer, bool) + 640
Crashed: com.apple.CFNetwork.Connection
0 libsystem_kernel.dylib 0x184f05338 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1850194d4 pthread_kill$VARIANT$mp + 360
2 libsystem_c.dylib 0x184e74b0c abort + 140
3 libsystem_c.dylib 0x184e485f0 basename_r + 314
4 CFNetwork 0x185aeca34 TCPIOConnection::_handleTLSEvent(nw_tls_context*, tls_handshake_message_t, void () block_pointer, bool) + 640
5 libnetwork.dylib 0x1862a88c0 __tcp_connection_set_tls_message_handler_on_nw_connection_block_invoke + 168
6 libboringssl.dylib 0x1861862c0 __boringssl_context_handshake_message_handler_block_invoke + 160
7 libdispatch.dylib 0x184d69e04 _dispatch_call_block_and_release + 24
8 libdispatch.dylib 0x184d69dc4 _dispatch_client_callout + 16
9 libdispatch.dylib 0x184d73ef4 _dispatch_queue_serial_drain$VARIANT$mp + 532
10 libdispatch.dylib …Run Code Online (Sandbox Code Playgroud) 我有一个使用NSWindow工具栏的应用程序.出于美观原因,我不希望用户能够自定义此工具栏.在Sierra中有一个新的菜单选项,可以插入到"菜单>视图"中Show Tab Bar.如何禁用此功能?启用它似乎只会增加工具栏的高度,因为我没有在图标下显示额外的标签.
我知道当使用核心动画层(CALayer)时,你必须在NSTextField后面有一个坚实的背景色,因为不支持子像素,但是我需要使用NSVisualEffectView后面的我NSOutlineView,我在顶部使用几个NSTextFields.如果我设置wantsLayer为YES NSOutlineView,遗憾的是顶部的文字变得很混乱.如何在顶部获得漂亮的模糊和流畅的文字?这是否意味着我们CALayer在使用NSVisualEffectView超级视图时根本无法使用?
以下代码行是我们的应用程序突然开始在iOS 11/11.0.1/11.0.2/11.1.1/11.2.2上针对某些用户崩溃的地方:
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
Run Code Online (Sandbox Code Playgroud)
我们有这个didFinishLaunchingWithOptions.崩溃报告说:
Fatal Exception: NSInternalInconsistencyException
Invalid parameter not satisfying: bundleProxy != nil
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x1869b3d38 __exceptionPreprocess
1 libobjc.A.dylib 0x185ec8528 objc_exception_throw
2 CoreFoundation 0x1869b3c0c +[NSException raise:format:]
3 Foundation 0x187342c24 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4 UserNotifications 0x18fcc973c -[UNUserNotificationCenter initWithBundleProxy:]
5 UserNotifications 0x18fcc950c __53+[UNUserNotificationCenter currentNotificationCenter]_block_invoke
6 libdispatch.dylib 0x186339048 _dispatch_client_callout
7 libdispatch.dylib 0x18633c710 dispatch_once_f$VARIANT$mp
8 UserNotifications 0x18fcc94ac +[UNUserNotificationCenter currentNotificationCenter]
Run Code Online (Sandbox Code Playgroud)
它来自iOS清楚.还有其他人遇到同样的错误吗?知道发生了什么事吗?
我有以下代码来读取传递的URL.我正在使用Pocket应用程序进行测试,虽然hasItemConformingToTypeIdentifier返回YES kUTTypeURL,尝试加载它返回错误而不是说明
"意外的价值等级."
.如果我尝试将其作为id<NSSecureCoding>项目和调试加载,我发现传入的对象确实只是页面的标题而不是URL.我如何阅读URL?
NSURL *pageURL = nil;
for (NSExtensionItem *item in self.extensionContext.inputItems) {
for (NSItemProvider *itemProvider in item.attachments) {
if ([itemProvider hasItemConformingToTypeIdentifier: (NSString*) kUTTypeURL]) {
[itemProvider loadItemForTypeIdentifier:(NSString*) kUTTypeURL options:nil completionHandler:^(id <NSSecureCoding> urlItem, NSError *error) {
if ([((NSObject*)urlItem) isKindOfClass: [NSURL class]]) {
pageURL = [((NSURL*)urlItem) absoluteString];
}
}];
}
}
}
Run Code Online (Sandbox Code Playgroud) 我没有使用自动布局,但我希望能够使我的(非常复杂的)应用程序适应iPad上的Split View多任务处理.为此,理想情况下,我想支持大小类,而不是沿着自动布局路线.观看WWDC 406会话似乎可以以编程方式执行此操作,但我不确定,因为他们在每个示例中都使用了Autolayout,否则甚至Interface构建器也不支持它.
如果我要收听有关特征变化的通知并以编程方式执行所有操作或使用引脚和支柱,我会遇到任何问题吗?我在Storyboard中定义了所有内容,但是当iPad在iOS 9中并排显示两个应用程序时,我希望能够支持不同大小的视图控制器.请提供建议.
我似乎无法在Widget模拟器中运行我的今日小部件(或任何扩展名).模拟器启动并说"无法打开小部件"
Failed to find Widget /Users/SomeUser/Library/Developer/Xcode/DerivedData/Build/Products/Debug/MyApp.app/Contents/PlugIns/MyApp.appex
Run Code Online (Sandbox Code Playgroud)
我查看了Console应用程序,我也看到了这个:
pkd [299]:忽略/Users/SomeUser/Library/Developer/Xcode/DerivedData/Build/Products/Debug/MyApp.app/Contents/PlugIns/MyApp.appex中错误配置的插件:插件必须是沙盒
但是它是用xcode沙箱的!它是编码,沙盒和批次.即使我尝试将其部署在新计算机上(使用我的开发人员配置文件注册为开发人员计算机),这些小部件也不会显示在"系统偏好设置"中.
知道我需要做什么吗?
我试图让我的NSScrollView(并因此包含NSOutlineView)使用模糊NSVisualEffectView的幕后混合效果.
我已成功制作NSVisualEffectView容器视图并将滚动视图作为子视图放置.这似乎工作正常(只要我使我的所有表格单元格,表格,nsscrollview等透明).
然而,我现在已经在"辅助功能"选项下改变了"降低透明度",突然之间,我的背后有一个黑色背景NSScrollView.我试图对视觉效果视图进行子类化以覆盖drawRect方法,以便我可以绘制自己的背景,但我刚刚学会了这是不可能的或推荐的.
如何检测"减少透明度"是否为"开启"以及如何动态地使滚动视图不透明?
objective-c nsoutlineview nsview osx-yosemite nsvisualeffectview
保存你自己的几个小时的调试,因为我已经浪费了2个星期后寻找神秘的应用程序崩溃的bug.事实证明,如果你向它添加了很多o(请参阅答案以获取更多详细信息)通知请求UNUserNotificationCenter,它将突然崩溃Springboard.我还没有找到解决方法,因为相同的代码适用于iOS 9及更低版本.您似乎无法批量添加之前的通知请求.以下是我每次收到的崩溃(数百名应用用户也是如此).知道我能做什么而不是回到使用UILocalNotifications?
Incident Identifier: 17BC9D5B-AF74-4592-8427-038375C27AE7
CrashReporter Key: a819553d1e72ee25a5ced9ddc79dbf00a7d3851f
Hardware Model: iPad5,3
Process: SpringBoard [2371]
Path: /System/Library/CoreServices/SpringBoard.app/SpringBoard
Identifier: com.apple.springboard
Version: 50 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.apple.springboard [71]
Date/Time: 2016-11-16 14:57:04.9159 +0400
Launch Time: 2016-11-16 14:49:20.9981 +0400
OS Version: iPhone OS 10.0 (14A5309d)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 13
Filtered syslog:
None found
Thread 0 name: Dispatch queue: …Run Code Online (Sandbox Code Playgroud) UITableView我已经掌握了一些细胞的基础知识。我使用 SwiftUIView作为单元格和节标题的内容。奇怪的是,只有 iPhone XS Max 上似乎接触屏幕底部的部分标题似乎获得了rawSafeAreaInset16 分(检查了“调试视图层次结构”)。我的细胞正在按预期工作。
为了看看发生了什么,我在 中添加了一个虚拟的蓝色 SwiftUI 矩形contentView,然后在顶部放置了一个红色 UIView,两个视图都设置为相同的约束。已UITableView设置为对标题和单元格使用自动尺寸。
public class SectionHeader: UITableViewHeaderFooterView {
public static let reusableIdentifier = "Section"
private var innerHostedViewController: UIHostingController<AnyView>!
public override init(reuseIdentifier: String?) {
super.init(reuseIdentifier: reuseIdentifier)
setupHeader()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupHeader() {
self.backgroundView = UIView()
self.backgroundView?.backgroundColor = UIColor.green.withAlphaComponent(0.2)
innerHostedViewController = UIHostingController(rootView: AnyView(Rectangle().fill(Color.blue).frame(height: 48)))
innerHostedViewController.view.translatesAutoresizingMaskIntoConstraints = false
innerHostedViewController.view.frame = self.contentView.bounds
contentView.addSubview(innerHostedViewController.view)
innerHostedViewController.view.backgroundColor = .clear …Run Code Online (Sandbox Code Playgroud) objective-c ×3
crash ×2
ios ×2
ios11 ×2
osx-yosemite ×2
autolayout ×1
cfnetwork ×1
cocoa ×1
crashlytics ×1
ios10 ×1
macos ×1
macos-sierra ×1
nsmenu ×1
nstextfield ×1
nsview ×1
nswindow ×1
size-classes ×1
swift ×1
swiftui ×1
uitableview ×1
xcode ×1
xcode6 ×1